Bug 13814 : add 6 unit tests in t/Boolean.t
authorJulian FIOL <julian.fiol@biblibre.com>
Mon, 9 Mar 2015 16:21:17 +0000 (17:21 +0100)
committerTomas Cohen Arazi <tomascohen@gmail.com>
Sun, 15 Mar 2015 11:57:16 +0000 (08:57 -0300)
Works as expected.
Signed-off-by: Marc Veron <veron@veron.ch>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
t/Boolean.t

index 0f04913..af81f13 100755 (executable)
@@ -2,19 +2,25 @@
 use strict;
 use warnings;
 
-use Test::More tests => 13;
+use Test::More tests => 19;
 
 BEGIN { use_ok( 'C4::Boolean', qw( true_p ) ); }
 
 is( true_p('0'),     '0', 'recognizes \'0\' as false' );
+is( true_p('nil'),     '0', 'recognizes \'nil\' as false' );
 is( true_p('false'), '0', 'recognizes \'false\' as false' );
 is( true_p('off'),   '0', 'recognizes \'off\' as false' );
 is( true_p('no'),    '0', 'recognizes \'no\' as false' );
+is( true_p('n'),    '0', 'recognizes \'n\' as false' );
+is( true_p('NO'),  '0', 'verified case insensitivity' );
 
 is( true_p('1'),    '1', 'recognizes \'1\' as true' );
+is( true_p('-1'),    '1', 'recognizes \'-1\' as true' );
+is( true_p('t'), '1', 'recognizes \'t\' as true' );
 is( true_p('true'), '1', 'recognizes \'true\' as true' );
 is( true_p('on'),   '1', 'recognizes \'on\' as true' );
 is( true_p('yes'),  '1', 'recognizes \'yes\' as true' );
+is( true_p('y'),  '1', 'recognizes \'y\' as true' );
 is( true_p('YES'),  '1', 'verified case insensitivity' );
 
 is( true_p(undef), undef, 'recognizes undefined as not boolean' );