diff options
| author | Mel <einebeere@gmail.com> | 2022-06-26 21:54:38 +0200 |
|---|---|---|
| committer | Mel <einebeere@gmail.com> | 2022-06-26 21:54:38 +0200 |
| commit | 18c7ab70ded45c76abb0b35c090b942a7bfcc3b4 (patch) | |
| tree | 6505f6197bd276b4a4bfbac3707064492c5626c8 /pkg/lang/compiler/compiler_test.go | |
| parent | 621f624f50a7bef16eeed02113b470e79e790cd9 (diff) | |
| download | jinx-18c7ab70ded45c76abb0b35c090b942a7bfcc3b4.tar.zst jinx-18c7ab70ded45c76abb0b35c090b942a7bfcc3b4.zip | |
Change arguments order in VM to match expectation
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 ` |
