diff options
author | Jarkko Hietaniemi <jhi@iki.fi> | 2000-12-06 16:41:03 +0000 |
---|---|---|
committer | Jarkko Hietaniemi <jhi@iki.fi> | 2000-12-06 16:41:03 +0000 |
commit | ecf52eaff85b11f185422cca63f828288260ff2e (patch) | |
tree | 0fee747a7e31bd3cb46feee1771d898c675f09cb /t/op | |
parent | c6eba7739afe8efbb2c458fd3d5b14d8ce029231 (diff) | |
download | perl-ecf52eaff85b11f185422cca63f828288260ff2e.tar.gz |
Test \x{...} with ord().
p4raw-id: //depot/perl@8015
Diffstat (limited to 't/op')
-rwxr-xr-x | t/op/ord.t | 19 |
1 files changed, 15 insertions, 4 deletions
diff --git a/t/op/ord.t b/t/op/ord.t index 22ff3af4ed..f664078d00 100755 --- a/t/op/ord.t +++ b/t/op/ord.t @@ -1,11 +1,11 @@ #!./perl -print "1..5\n"; +print "1..8\n"; # compile time evaluation -# 65 ASCII -# 193 EBCDIC +# 'A' 65 ASCII +# 'A' 193 EBCDIC if (ord('A') == 65 || ord('A') == 193) {print "ok 1\n";} else {print "not ok 1\n";} print "not " unless ord(chr(500)) == 500; @@ -18,6 +18,17 @@ if (ord($x) == 65 || ord($x) == 193) {print "ok 3\n";} else {print "not ok 3\n"; if (chr 65 eq 'A' || chr 193 eq 'A') {print "ok 4\n";} else {print "not ok 4\n";} +print "not " unless ord(chr(500)) == 500; +print "ok 5\n"; + $x = 500; print "not " unless ord(chr($x)) == $x; -print "ok 5\n"; +print "ok 6\n"; + +print "not " unless ord("\x{1234}") == 0x1234; +print "ok 7\n"; + +$x = "\x{1234}"; +print "not " unless ord($x) == 0x1234; +print "ok 8\n"; + |