diff options
Diffstat (limited to 'pkg/lang/compiler/compiler_test.go')
| -rw-r--r-- | pkg/lang/compiler/compiler_test.go | 36 |
1 files changed, 18 insertions, 18 deletions
diff --git a/pkg/lang/compiler/compiler_test.go b/pkg/lang/compiler/compiler_test.go index 5347830..cf0fee2 100644 --- a/pkg/lang/compiler/compiler_test.go +++ b/pkg/lang/compiler/compiler_test.go @@ -19,8 +19,8 @@ func TestSimpleAddExpr(t *testing.T) { ` expected := ` - push_int 2 push_int 1 + push_int 2 add ` @@ -37,12 +37,12 @@ func TestOperationOrder(t *testing.T) { ` expected := ` - push_int 4 - push_int 3 - push_int 2 push_int 1 + push_int 2 add + push_int 3 sub + push_int 4 add ` @@ -57,25 +57,25 @@ func TestNestedExpr(t *testing.T) { ` expected := ` - push_int 321 - push_int 456 - index + push_int 1 + push_int 2 + add + + push_int 3 + sub - push_string "c" - push_string "b" - push_string "a" push_int 123 + push_string "a" + push_string "b" + push_string "c" call 3 - add - - push_int 3 + push_int 456 + push_int 321 + index - push_int 2 - push_int 1 add sub - sub ` mustCompileTo(t, src, expected) @@ -95,13 +95,13 @@ func TestVars(t *testing.T) { push_int 25 - push_int 7 get_local 0 + push_int 7 add set_local 0 - get_local 1 get_local 0 + get_local 1 add ` |
