Skip to content

Commit

Permalink
rewrite remaining failing integration tests
Browse files Browse the repository at this point in the history
  • Loading branch information
cotto committed Jun 3, 2011
1 parent e6953c4 commit dd7ba4c
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 22 deletions.
34 changes: 19 additions & 15 deletions t/m0/integration/m0_labels_with_goto.m0
Original file line number Diff line number Diff line change
@@ -1,25 +1,29 @@
.version 0
.chunk "label_with_goto_after"
.constants
0 1
1 "1..1"
2 "ok 1 goto works with a label defined after its use"
3 "n"
0 "1..1"
1 "ok 1 goto works with a label defined after its use"
2 "n"
.metadata
.bytecode
# test that the assembler generate code for a goto
# I0 = 1
set_var I0, 0, 0
# S0 = "1..1"
set_var S0, 0, 1
# S1 = "ok 1"...
set_var S1, 0, 2
# S2 = "n"
set_var S2, 0, 3
# S0 = "1..1"
set_imm S0, 0, 0
deref S0, CONSTS, S0

print_s I0, S0, x
goto no_n, x
print_s I0, S2, x
# S1 = "ok 1 ..."
set_imm S1, 0, 1
deref S1, CONSTS, S1

# S2 = "n"
set_imm S2, 0, 2
deref S2, CONSTS, S2

set_imm I0, 0, 1

print_s I0, S0, x
goto no_n
print_s I0, S2, x

no_n:
print_s I0, S1, x
13 changes: 7 additions & 6 deletions t/m0/integration/m0_labels_without_goto.m0
Original file line number Diff line number Diff line change
@@ -1,16 +1,17 @@
.version 0
.chunk "label_without_goto"
.constants
0 1
1 "1..1"
2 "ok 1 labels are parsed ok"
0 "1..1"
1 "ok 1 labels are parsed ok"
.metadata
.bytecode
# test that the assembler can parse labels
label0:
label333:
label1: set_var S0, 0, 1
label2: set_var S1, 0, 2
set_var I0, 0, 0
label1: set_imm S0, 0, 0
deref S0, CONSTS, S0
label2: set_imm S1, 0, 1
deref S1, CONSTS, S1
set_imm I0, 0, 1
label_99: print_s I0, S0, 42
label: print_s I0, S1, 42
2 changes: 1 addition & 1 deletion t/m0/m0_run_hello_m0b.t
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ Run the canonically "correct", hand-assembled hello_canon.m0b.

my $m0_interp = "$^X src/m0/perl5/m0_interp.pl";

my $output = `$m0_interp t/m0/integration/hello_canon.m0b`;
my $output = `$m0_interp t/m0/basic/hello_canon.m0b`;

is($output, "hello world\n", "hello world m0b works");

Expand Down

0 comments on commit dd7ba4c

Please sign in to comment.