diff options
author | Jarkko Hietaniemi <jhi@iki.fi> | 2001-11-10 06:38:07 +0000 |
---|---|---|
committer | Jarkko Hietaniemi <jhi@iki.fi> | 2001-11-10 06:38:07 +0000 |
commit | 4e002eb05459a979289e3370d725d5d3a3407109 (patch) | |
tree | bf87c9a4454ebba1c39f106d4431d8568782daa8 /lib | |
parent | c26c758be9c6b4b88aa5d07ac4631a815b5f2e2f (diff) | |
download | perl-4e002eb05459a979289e3370d725d5d3a3407109.tar.gz |
Add a test for the bytes pragma.
p4raw-id: //depot/perl@12929
Diffstat (limited to 'lib')
-rw-r--r-- | lib/bytes.t | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/lib/bytes.t b/lib/bytes.t new file mode 100644 index 0000000000..05c748c5ac --- /dev/null +++ b/lib/bytes.t @@ -0,0 +1,28 @@ +BEGIN { + chdir 't' if -d 't'; + @INC = '../lib'; +} + +print "1..6\n"; + +my $a = chr(0x0100); + +print ord($a) == 0x100 ? "ok 1\n" : "not ok 1\n"; +print length($a) == 1 ? "ok 2\n" : "not ok 2\n"; + +{ + use bytes; + my $b = chr(0x0100); + print ord($b) == 0 ? "ok 3\n" : "not ok 3\n"; +} + +my $c = chr(0x0100); + +print ord($c) == 0x100 ? "ok 4\n" : "not ok 4\n"; + +{ + use bytes; + print ord($c) == 0xc4 ? "ok 5\n" : "not ok 5\n"; + print length($c) == 2 ? "ok 6\n" : "not ok 6\n"; +} + |