diff options
author | Gurusamy Sarathy <gsar@cpan.org> | 2000-02-28 09:39:47 +0000 |
---|---|---|
committer | Gurusamy Sarathy <gsar@cpan.org> | 2000-02-28 09:39:47 +0000 |
commit | 0c57e439868bda58b2cbd4708d7a8b4dcf15b989 (patch) | |
tree | 2ac09b0f11a516587e72d50798bf1b68b26b0391 /t/op/bop.t | |
parent | 2a7df08c305fc4608f99354a5d2f30a93594db08 (diff) | |
download | perl-0c57e439868bda58b2cbd4708d7a8b4dcf15b989.tar.gz |
make stringwise bitops work properly on utf8 strings
p4raw-id: //depot/perl@5317
Diffstat (limited to 't/op/bop.t')
-rwxr-xr-x | t/op/bop.t | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/t/op/bop.t b/t/op/bop.t index 0c5ef4874d..7bcabdfd58 100755 --- a/t/op/bop.t +++ b/t/op/bop.t @@ -9,7 +9,7 @@ BEGIN { unshift @INC, '../lib'; } -print "1..18\n"; +print "1..30\n"; # numerics print ((0xdead & 0xbeef) == 0x9ead ? "ok 1\n" : "not ok 1\n"); @@ -62,3 +62,22 @@ print (($foo | $bar) eq ($Aoz x 75 . $zap) ? "ok 17\n" : "not ok 17\n"); # ^ does not truncate print (($foo ^ $bar) eq ($Axz x 75 . $zap) ? "ok 18\n" : "not ok 18\n"); +# +print "ok \xFF\xFF\n" & "ok 19\n"; +print "ok 20\n" | "ok \0\0\n"; +print "o\000 \0001\000" ^ "\000k\0002\000\n"; + +# +print "ok \x{FF}\x{FF}\n" & "ok 22\n"; +print "ok 23\n" | "ok \x{0}\x{0}\n"; +print "o\x{0} \x{0}4\x{0}" ^ "\x{0}k\x{0}2\x{0}\n"; + +# +print "ok 25\n" if sprintf("%vd", v4095 & v801) eq 801; +print "ok 26\n" if sprintf("%vd", v4095 | v801) eq 4095; +print "ok 27\n" if sprintf("%vd", v4095 ^ v801) eq 3294; + +# +print "ok 28\n" if sprintf("%vd", v4095.801.4095 & v801.4095) eq '801.801'; +print "ok 29\n" if sprintf("%vd", v4095.801.4095 | v801.4095) eq '4095.4095.4095'; +print "ok 30\n" if sprintf("%vd", v801.4095 ^ v4095.801.4095) eq '3294.3294.4095'; |