12 pass("logical negation of empty list") if not();
13 is(not(), 1, "logical negation of empty list in numeric comparison");
15 "logical negation of empty list compared with logical negation of false value");
18 note("parens needed around second argument in next two tests\nto preserve list context inside function call");
20 "high- and low-precedence logical negation of true value");
22 "high- and low-precedence logical negation of false value");
23 is(! (0, 0), not(0, 0),
24 "high- and low-precedence logical negation of lists");
26 # test the return of !
33 "logical negation (high-precedence) of true value is numerically equal to undefined value");
35 "logical negation (high-precedence) of true value is numerically equal to empty list");
39 "logical negation (high-precedence) of true value in string context is equal to empty string");
41 "logical negation (high-precedence) of true value is false in numeric context");
43 "logical negation (high-precedence) of false value is true in numeric context");
46 # test the return of not
53 "logical negation (low-precedence) of true value is numerically equal to undefined value");
55 "logical negation (low-precedence) of true value is numerically equal to empty list");
59 "logical negation (low-precedence) of true value in string context is equal to empty string");
61 "logical negation (low-precedence) of true value is false in numeric context");
63 "logical negation (low-precedence) of false value is true in numeric context");
66 # test truth of dualvars
70 eval 'use Scalar::Util "dualvar"; $got_dualvar++';
71 skip "No Scalar::Util::dualvar", 3 unless $got_dualvar;
72 my $a = Scalar::Util::dualvar(3, "");
73 is not($a), 1, 'not(dualvar) ignores int when string is false';
74 my $b = Scalar::Util::dualvar(3.3,"");
75 is not($b), 1, 'not(dualvar) ignores float when string is false';
76 my $c = Scalar::Util::dualvar(0,"1");
77 is not($c), "", 'not(dualvar) ignores false int when string is true';