Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
branch: master
Fetching contributors…

Octocat-spinner-32-eaf2f5

Cannot retrieve contributors at this time

file 39 lines (29 sloc) 1.297 kb
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38
use v6;
use Test;
plan 22;

# L<S03/Loose unary precedence>

nok(not 1, "not 1 is false");
nok(not -1, "not -1 is false");
nok(!(not 0), "!not 0 is false");
nok(not sub{}, 'not sub{} is false');
nok(not "x", 'not "x" is false');

my $a = 1; nok(not $a, 'not $not_var is false');
my $b = 0; nok(!(not $b), 'not $false_var is not false');

#?rakudo todo 'RT 65556'
is (not($b) + 1), ((not $b) + 1), 'not($b) is (not $b)';

ok( not(not 42), "not(not 42) is true");
ok(!not(not 0), "not(not 0) is false");

is(not Bool::True, Bool::False, "'Bool::True' is not 'Bool::False'");
isa_ok(not Bool::True, Bool, "'not Bool::True' is a Bool");
is(not Bool::True, False, "'Bool::True' is not 'False'");
is(not True, False, "'True' is not 'False'");
isa_ok(not True, Bool, "'not True' is a Bool");
is(not True, Bool::False, "'True' is not 'Bool::False'");

is(not Bool::False, Bool::True, "'Bool::False' is not 'Bool::True'");
isa_ok(not Bool::False, Bool, "'not Bool::False' is a Bool");
is(not Bool::False, True, "'Bool::False' is not 'True'");
is(not False, True, "'False' is not 'True'");
isa_ok(not False, Bool, "'not False' is a Bool");
is(not False, Bool::True, "'False' is not 'Bool::True'");

done;

# vim: ft=perl6
Something went wrong with that request. Please try again.