summaryrefslogtreecommitdiff
path: root/t/op/not.t
diff options
context:
space:
mode:
authorSteve Peters <steve@fisharerojo.org>2005-02-14 13:54:17 -0600
committerMarcus Holland-Moritz <mhx-perl@gmx.net>2005-02-15 04:58:48 +0000
commit1b293ed1e0e66b606ed121bd34c8112e6fd8e30d (patch)
treee2017f6a984737f9ec2e42cbd5cdb31704a4c34e /t/op/not.t
parent08ca2aa38a29585fadf425ad3ad4f05750717023 (diff)
downloadperl-1b293ed1e0e66b606ed121bd34c8112e6fd8e30d.tar.gz
Additional tests for t/op/not.t
Message-ID: <20050215015417.GA30368@mccoy.peters.homeunix.org> p4raw-id: //depot/perl@23967
Diffstat (limited to 't/op/not.t')
-rw-r--r--t/op/not.t38
1 files changed, 37 insertions, 1 deletions
diff --git a/t/op/not.t b/t/op/not.t
index 5ff65beaa1..3d07797daa 100644
--- a/t/op/not.t
+++ b/t/op/not.t
@@ -6,8 +6,44 @@ BEGIN {
require './test.pl';
}
-plan tests => 3;
+plan tests => 16;
+# not() tests
pass() if not();
is(not(), 1);
is(not(), not(0));
+
+# test not(..) and !
+is(! 1, not 1);
+is(! 0, not 0);
+is(! (0, 0), not(0, 0));
+
+# test the return of !
+{
+ my $not0 = ! 0;
+ my $not1 = ! 1;
+
+ no warnings;
+ ok($not1 == undef);
+ ok($not1 == ());
+
+ use warnings;
+ ok($not1 eq '');
+ ok($not1 == 0);
+ ok($not0 == 1);
+}
+
+# test the return of not
+{
+ my $not0 = not 0;
+ my $not1 = not 1;
+
+ no warnings;
+ ok($not1 == undef);
+ ok($not1 == ());
+
+ use warnings;
+ ok($not1 eq '');
+ ok($not1 == 0);
+ ok($not0 == 1);
+}