Skip to content

Commit

Permalink
[t] Add tests for r49514
Browse files Browse the repository at this point in the history
git-svn-id: https://svn.parrot.org/parrot/trunk@49515 d31e2699-5ff4-0310-a27c-f18f2fbe73fe
  • Loading branch information
nwellnhof committed Oct 11, 2010
1 parent 675d90b commit ed87114
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 2 deletions.
16 changes: 15 additions & 1 deletion t/tools/pbc_disassemble.t
Expand Up @@ -45,7 +45,7 @@ BEGIN {
plan skip_all => "pbc_disassemble hasn't been built. Run make parrot_utils";
exit(0);
}
plan tests => 4;
plan tests => 6;
}

disassemble_output_like( <<PIR, "pir", qr/PMC_CONST.*set_n_nc.*print_n/ms, 'pbc_disassemble numeric ops');
Expand Down Expand Up @@ -80,6 +80,20 @@ disassemble_output_like( <<PIR, "pir", qr/PMC_CONST.*set_s_sc\s*S.*print_s\s*S.*
.end
PIR

disassemble_output_like( <<PIR, "pir", qr/set_s_sc S0,utf8:"Hello"/ms, 'pbc_disassemble utf8 string');
.sub main :main
\$S0 = utf8:"Hello"
.end
PIR

my $utf16 = pack('S*', unpack('C*', 'Hello'));
$utf16 =~ s/\0/\\\\0/g;
disassemble_output_like( <<PIR, "pir", qr/set_s_sc S0,utf16:"$utf16"/ms, 'pbc_disassemble utf16 string');
.sub main :main
\$S0 = utf16:"Hello"
.end
PIR

=head1 HELPER SUBROUTINES
=head2 disassemble_output_like
Expand Down
10 changes: 9 additions & 1 deletion t/tools/pbc_dump.t
Expand Up @@ -45,7 +45,7 @@ BEGIN {
plan skip_all => "pbc_dump hasn't been built. Run make parrot_utils";
exit(0);
}
plan tests => 7;
plan tests => 13;
}

dump_output_like( <<PIR, "pir", [qr/CONSTANT_t/, qr/BYTECODE_t/], 'pbc_dump basic sanity');
Expand All @@ -72,6 +72,14 @@ dump_output_like( <<PIR, "pir", qr/BYTECODE_t.*=>.*\[.*offs.*op_count.*itype.*id
.end
PIR

for my $enc qw(binary iso-8859-1 utf8 utf16 ucs2 ucs4) {
dump_output_like( <<PIR, "pir", qr/ENCODING.*=>.*$enc/ms, "pbc_dump $enc encoding");
.sub main :main
\$S0 = $enc:"abc"
.end
PIR
}

my $longcode = ".sub main :main\n";
for (0 ... 10000) {
$longcode .= "\$I0 = \$I0 + 1234\n";
Expand Down

0 comments on commit ed87114

Please sign in to comment.