summaryrefslogtreecommitdiff
path: root/t/op/vec.t
diff options
context:
space:
mode:
authorGurusamy Sarathy <gsar@cpan.org>2000-06-01 09:38:21 +0000
committerGurusamy Sarathy <gsar@cpan.org>2000-06-01 09:38:21 +0000
commit4ebbc97598d793d933009eab4334e3bc88b8de4e (patch)
treebd34fe0190a421a881e13f6c1e18d7178999a3c5 /t/op/vec.t
parentc0c883f471ccfb5834fe4c67653150bc540120d7 (diff)
downloadperl-4ebbc97598d793d933009eab4334e3bc88b8de4e.tar.gz
vec() loses numericalness (modified version of patch suggested
by Robin Barker) p4raw-id: //depot/perl@6191
Diffstat (limited to 't/op/vec.t')
-rwxr-xr-xt/op/vec.t12
1 files changed, 9 insertions, 3 deletions
diff --git a/t/op/vec.t b/t/op/vec.t
index bf60fc4a08..b8efb8011d 100755
--- a/t/op/vec.t
+++ b/t/op/vec.t
@@ -1,8 +1,6 @@
#!./perl
-# $RCSfile: vec.t,v $$Revision: 4.1 $$Date: 92/08/07 18:28:36 $
-
-print "1..15\n";
+print "1..18\n";
print vec($foo,0,1) == 0 ? "ok 1\n" : "not ok 1\n";
print length($foo) == 0 ? "ok 2\n" : "not ok 2\n";
@@ -25,3 +23,11 @@ vec($Vec, 0, 32) = 0xbaddacab;
print $Vec eq "\xba\xdd\xac\xab" ? "ok 14\n" : "not ok 14\n";
print vec($Vec, 0, 32) == 3135089835 ? "ok 15\n" : "not ok 15\n";
+# ensure vec() handles numericalness correctly
+$foo = $bar = $baz = 0;
+vec($foo = 0,0,1) = 1;
+vec($bar = 0,1,1) = 1;
+$baz = $foo | $bar;
+print $foo eq "1" && $foo == 1 ? "ok 16\n" : "not ok 16\n";
+print $bar eq "2" && $bar == 2 ? "ok 17\n" : "not ok 17\n";
+print "$foo $bar $baz" eq "1 2 3" ? "ok 18\n" : "not ok 18\n";