Skip to content

Commit

Permalink
[t] Increase code coverage of pbc_dump packdump
Browse files Browse the repository at this point in the history
  • Loading branch information
fernandobrito committed Jan 10, 2011
1 parent dce9186 commit 56db93d
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions t/tools/pbc_dump.t
Expand Up @@ -166,7 +166,15 @@ my (undef, $pbcpack_file) = create_tempfile( SUFFIX => '.pbc', UNLINK => 1 );

print $pir_i <<'EOF';
.sub main :main
print 'Hello World'
$P0 = new ['Hash']
$P0['mykey'] = 'myvalue'
$P0['mykey';0] = 2
$P1 = new ['FixedStringArray'], 1
$P1[0] = "first"
.const 'String' s = "Hello World"
print s
.end
EOF
close $pir_i;
Expand All @@ -175,7 +183,7 @@ close $pir_i;
system($PARROT, '-o', $pbc_file, $pir_file);

# Test -n option
dump_raw_output_like("-n " . $pbc_file, qr/0002: print_sc.*0002: end/s, "pbc_dump -n command");
dump_raw_output_like("-n " . $pbc_file, qr/000a: end/s, "pbc_dump -n command");

# Test -t option
dump_raw_output_like("-t " . $pbc_file, qr/HEADER.*DIRECTORY.*BYTECODE.*CONSTANT/s, "pbc_dump -t command");
Expand Down

0 comments on commit 56db93d

Please sign in to comment.