diff options
author | Vincent Pit <perl@profvince.com> | 2008-08-30 00:47:28 +0200 |
---|---|---|
committer | Rafael Garcia-Suarez <rgarciasuarez@gmail.com> | 2008-09-07 21:32:44 +0000 |
commit | edbe35ea95baf286c38bf4d7db7d18b82ecce254 (patch) | |
tree | adb91b86b01e307776b416f8d88b0fe5c0de22d9 /t/op/lop.t | |
parent | 5625ef69b645a2ef31d454433f1d69f8d40af74f (diff) | |
download | perl-edbe35ea95baf286c38bf4d7db7d18b82ecce254.tar.gz |
Re: unless(...) terser than if(!...)
Message-ID: <48B86060.4090905@profvince.com>
p4raw-id: //depot/perl@34310
Diffstat (limited to 't/op/lop.t')
-rwxr-xr-x | t/op/lop.t | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/t/op/lop.t b/t/op/lop.t index d57271abd6..a78ac728ae 100755 --- a/t/op/lop.t +++ b/t/op/lop.t @@ -9,7 +9,7 @@ BEGIN { @INC = '../lib'; } -print "1..7\n"; +print "1..9\n"; my $test = 0; for my $i (undef, 0 .. 2, "", "0 but true") { @@ -42,3 +42,13 @@ my $i = 0; (($i ||= 1) &&= 3) += 4; print "not " unless $i == 7; print "ok ", ++$test, "\n"; + +my ($x, $y) = (1, 8); +$i = !$x || $y; +print "not " unless $i == 8; +print "ok ", ++$test, "\n"; + +($x, $y) = (0, 9); +$i = !$x && $y; +print "not " unless $i == 9; +print "ok ", ++$test, "\n"; |