Skip to content

Commit

Permalink
fixed t/pmc/iterator.t tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Jimmy Zhuo committed May 3, 2012
1 parent 3490971 commit 41ab4a5
Showing 1 changed file with 15 additions and 15 deletions.
30 changes: 15 additions & 15 deletions t/pmc/iterator.t
Original file line number Diff line number Diff line change
Expand Up @@ -57,19 +57,19 @@ pir_output_is( <<'CODE', <<'OUTPUT', "keyed access on String and Hash PMCs" );
new $P2, ['Integer']
set $P2, 1
iter $P1, $P0
set $I0, $P1[P2]
set $I0, $P1[$P2]
eq $I0, 32, OK1
print "not "
OK1:print "ok 1\n"
set $P2, 0
set $I0, $P1[P2]
set $I0, $P1[$P2]
eq $I0, 73, OK2
print "not "
OK2:print "ok 2\n"
set $P2, 5
set $S0, $P1[P2]
set $S0, $P1[$P2]
eq $S0, 'a', OK3
print "not "
OK3:print "ok 3\n"
Expand All @@ -79,13 +79,13 @@ OK3:print "ok 3\n"
set $P0['herp'], 2
iter $P1, $P0
set $P2, 'herp'
set $N0, $P1[P2]
set $N0, $P1[$P2]
eq $N0, 2, OK4
print "not "
OK4:print "ok 4\n"
set $P2, 'derp'
set $N0, $P1[P2]
set $N0, $P1[$P2]
eq $N0, 3.257, OK5
print "not "
OK5:print "ok 5\n"
Expand All @@ -107,13 +107,13 @@ pir_output_is( <<'CODE', <<'OUTPUT', "keyed exist and defined on String and Hash
new $P2, ['Integer']
set $P2, 2
exists $I0, $P1[P2]
exists $I0, $P1[$P2]
eq $I0, 1, OK1
print "not "
OK1:print "ok 1\n"
set $P2, 20
exists $I0, $P1[P2]
exists $I0, $P1[$P2]
eq $I0, 0, OK2
print "not "
OK2:print "ok 2\n"
Expand All @@ -129,13 +129,13 @@ OK3:print "ok 3\n"
set $P0['nothing'], 'something'
iter $P1, $P0
set $P2, 'something'
defined $I0, $P1[P2]
defined $I0, $P1[$P2]
eq $I0, 1, OK4
print "not "
OK4:print "ok 4\n"
set $P2, 'somenothing'
defined $I0, $P1[P2]
defined $I0, $P1[$P2]
eq $I0, 0, OK5
print "not "
OK5:print "ok 5\n"
Expand Down Expand Up @@ -421,7 +421,7 @@ pir_output_is( <<'CODE', <<'OUTPUT', "Hash iter 2" );
set $I10, $I1
fill:
chr $S0, $I0
set $P0[S0], $I0
set $P0[$S0], $I0
inc $I0
dec $I1
if $I1, fill
Expand All @@ -436,8 +436,8 @@ ok1:
get:
unless $P1, done
shift $S3, $P1 # get hash.key
set $I0, $P0[S3] # and value
set $P2[S3], $I0
set $I0, $P0[$S3] # and value
set $P2[$S3], $I0
branch get
done:
Expand Down Expand Up @@ -544,7 +544,7 @@ CODE
ABC
OUTPUT

pir_output_is( << 'CODE', << 'OUTPUT', "String iterator in $PIR" );
pir_output_is( << 'CODE', << 'OUTPUT', "String iterator in PIR" );
.include "iterator.pir"
.sub _main :main
Expand All @@ -560,11 +560,11 @@ pir_output_is( << 'CODE', << 'OUTPUT', "String iterator in $PIR" );
.local int code_point_1
ITER_LOOP:
unless iter_1 goto $ITER_END
unless iter_1 goto ITER_END
shift code_point_1, iter_1
print code_point_1
print "\n"
branch $ITER_LOOP
branch ITER_LOOP
ITER_END:
print "reached end\n"
end
Expand Down

0 comments on commit 41ab4a5

Please sign in to comment.