[Koha-bugs] [Bug 29746] Add a handy Koha::Result::Boolean class

bugzilla-daemon at bugs.koha-community.org bugzilla-daemon at bugs.koha-community.org
Tue Jan 4 20:22:55 CET 2022


https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29746

--- Comment #17 from Tomás Cohen Arazi <tomascohen at gmail.com> ---
Created attachment 129007
  -->
https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=129007&action=edit
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 at theke.io>

-- 
You are receiving this mail because:
You are watching all bug changes.


More information about the Koha-bugs mailing list