Skip to content

Commit

Permalink
[t] Test ord with different Unicode encodings
Browse files Browse the repository at this point in the history
  • Loading branch information
nwellnhof committed Nov 30, 2010
1 parent 4c93dc1 commit 1f7b157
Showing 1 changed file with 34 additions and 1 deletion.
35 changes: 34 additions & 1 deletion t/op/stringu.t
Expand Up @@ -5,7 +5,7 @@ use strict;
use warnings;
use lib qw( . lib ../lib ../../lib );
use Test::More;
use Parrot::Test tests => 40;
use Parrot::Test tests => 41;
use Parrot::Config;

=head1 NAME
Expand Down Expand Up @@ -1045,6 +1045,39 @@ CODE
OUT
}

pir_output_is(<<'CODE', <<'OUTPUT', 'ord with Unicode encodings' );
.sub 'main'
test(utf8:"a\uBABEb c\uBEEFd")
test(utf16:"a\uBABEb c\uBEEFd")
test(ucs2:"a\uBABEb c\uBEEFd")
test(ucs4:"a\uBABEb c\uBEEFd")
.end
.sub 'test'
.param string str
.local int c
c = ord str, -2
say c
push_eh handler
c = ord str, 100
print "not "
handler:
say "ok"
pop_eh
.end
CODE
48879
ok
48879
ok
48879
ok
48879
ok
OUTPUT

# Local Variables:
# mode: cperl
# cperl-indent-level: 4
Expand Down

0 comments on commit 1f7b157

Please sign in to comment.