1#!./perl -w
2
3BEGIN {
4    chdir 't' if -d 't';
5    @INC = '../lib';
6    require './test.pl';
7}
8
9plan tests => 16;
10
11# not() tests
12pass() if not();
13is(not(), 1);
14is(not(), not(0));
15
16# test not(..) and !
17is(! 1, not 1);
18is(! 0, not 0);
19is(! (0, 0), not(0, 0));
20
21# test the return of !
22{
23    my $not0 = ! 0;
24    my $not1 = ! 1;
25
26    no warnings;
27    ok($not1 == undef);
28    ok($not1 == ());
29
30    use warnings;
31    ok($not1 eq '');
32    ok($not1 == 0);
33    ok($not0 == 1);
34}
35
36# test the return of not
37{
38    my $not0 = not 0;
39    my $not1 = not 1;
40
41    no warnings;
42    ok($not1 == undef);
43    ok($not1 == ());
44
45    use warnings;
46    ok($not1 eq '');
47    ok($not1 == 0);
48    ok($not0 == 1);
49}
50