summaryrefslogtreecommitdiff
path: root/t/cmd
diff options
context:
space:
mode:
authorPerl 5 Porters <perl5-porters@africa.nicoh.com>1996-05-01 02:08:47 +0000
committerCharles Bailey <bailey@genetics.upenn.edu>1996-05-01 02:08:47 +0000
commit1aec87665f8e9d20b16fa65742563d5867f3b4c7 (patch)
tree2480b29b36a6c7dfae90ac3538f784077a9081b7 /t/cmd
parentbcce72a7a81d4c8e03d40bd0de22a534dc97418b (diff)
downloadperl-1aec87665f8e9d20b16fa65742563d5867f3b4c7.tar.gz
Add tests to check treatment of numbers between 0 and -1
Diffstat (limited to 't/cmd')
-rwxr-xr-xt/cmd/mod.t16
1 files changed, 15 insertions, 1 deletions
diff --git a/t/cmd/mod.t b/t/cmd/mod.t
index 9d9170ff3f..b4f2731ffa 100755
--- a/t/cmd/mod.t
+++ b/t/cmd/mod.t
@@ -2,7 +2,7 @@
# $RCSfile: mod.t,v $$Revision: 4.1 $$Date: 92/08/07 18:27:11 $
-print "1..7\n";
+print "1..11\n";
print "ok 1\n" if 1;
print "not ok 1\n" unless 1;
@@ -31,3 +31,17 @@ open(foo,'./TEST') || open(foo,'TEST') || open(foo,'t/TEST');
$x = 0;
$x++ while <foo>;
print $x > 50 && $x < 1000 ? "ok 7\n" : "not ok 7\n";
+
+$x = -0.5;
+print "not " if scalar($x) < 0 and $x >= 0;
+print "ok 8\n";
+
+print "not " unless (-(-$x) < 0) == ($x < 0);
+print "ok 9\n";
+
+print "ok 10\n" if $x < 0;
+print "not ok 10\n" unless $x < 0;
+
+print "ok 11\n" unless $x > 0;
+print "not ok 11\n" if $x > 0;
+