]> git.koha-community.org Git - koha.git/commit
Bug 29746: (it-doesn't-hurt follow-up) More tests
authorTomas Cohen Arazi <tomascohen@theke.io>
Tue, 4 Jan 2022 18:58:54 +0000 (15:58 -0300)
committerFridolin Somers <fridolin.somers@biblibre.com>
Wed, 5 Jan 2022 23:33:46 +0000 (13:33 -1000)
commit367a90ca189b0c3f49a7b3a87ce023070a7f05ea
tree4afe1c538fc751aa056125fb68e46df2a3ece64b
parenta8ab17f82326e34b7a6708e636ab56230a7399a0
Bug 29746: (it-doesn't-hurt follow-up) More tests

In an attempt to add (even) more tests for this library, we wanted to
add tests for the return values initialization and then hit
a wall when trying to add tests: Test::More tries to compare in string
context first [1], and when you force integer context (by using cmp_ok +
'==') it tells '==' is not overridden for the class.

So this patch adds those tests, and also the overloaded '==' operator
that is required for such tests.

To test:
1. Apply this patch
2. Run:
   $ kshell
  k$ prove t/Koha/Result/Boolean.t
=> SUCCESS: Tests pass
3. Sign off :-D

[1] https://metacpan.org/pod/Test::More#Overloaded-objects

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Koha/Result/Boolean.pm
t/Koha/Result/Boolean.t