Skip to content
Fetching contributors…
Cannot retrieve contributors at this time
24 lines (19 sloc) 573 Bytes
use v6;
use Test;
plan 8;
#L<S03/Smart matching/Any Bool simple truth>
{
sub is-true() { True };
sub is-false() { False };
ok 0 ~~ is-true(), '~~ non-syntactic True';
ok 'a' ~~ is-true(), '~~ non-syntactic True';
nok 0 ~~ is-false(), '~~ non-syntactic True';
nok 'a' ~~ is-false(), '~~ non-syntactic True';
}
{
nok 0 ~~ .so, 'boolean truth';
ok 'a' ~~ .so, 'boolean truth';
ok 0 ~~ .not, 'boolean truth';
nok 'a' ~~ .not, 'boolean truth';
}
# vim: ft=perl6
Jump to Line
Something went wrong with that request. Please try again.