Skip to content

Commit aec5f6e

Browse files
committed
[coverage] Cover all uncovered operators in Bool.pm
1 parent cb31fae commit aec5f6e

File tree

1 file changed

+19
-1
lines changed

1 file changed

+19
-1
lines changed

S02-types/bool.t

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
use v6;
22
use Test;
3-
plan 56;
3+
plan 66;
44

55
#L<S12/Built-in Enumerations/"Two built-in enumerations are">
66

@@ -111,4 +111,22 @@ is(--$bool, Bool::False, 'Decrement of Bool::False produces Bool::False');
111111
is $b.Int, 1, 'Bool typed scalar coerces to Int';
112112
}
113113

114+
{ # coverage; 2016-09-25
115+
is-deeply ?Bool, Bool::False, '?Bool:U returns False';
116+
is-deeply (so Bool), Bool::False, 'so Bool:U returns False';
117+
is infix:<^^>(
118+
Any, sub { pass 'sub{} operand of ^^ op gets called'; 42 },
119+
), 42, '^^ operator with sub {} right operand works correctly';
120+
121+
is infix:<//>(
122+
Any, sub { pass 'sub{} operand of // op gets called'; 42 },
123+
), 42, '// operator with sub {} right operand works correctly';
124+
is infix:<xor>(
125+
Any, sub { pass 'sub{} operand of xor op gets called'; 42 },
126+
), 42, 'xor operator with sub {} right operand works correctly';
127+
128+
is infix:<and>(42), 42, 'infix:<and> with 1 arg returns the arg';
129+
is infix:<and>( ), Bool::True, 'infix:<and> with no args returns True';
130+
}
131+
114132
# vim: ft=perl6

0 commit comments

Comments
 (0)