From 18c7ab70ded45c76abb0b35c090b942a7bfcc3b4 Mon Sep 17 00:00:00 2001 From: Mel Date: Sun, 26 Jun 2022 21:54:38 +0200 Subject: Change arguments order in VM to match expectation --- pkg/lang/compiler/compiler_test.go | 36 ++++++++++++++++++------------------ 1 file changed, 18 insertions(+), 18 deletions(-) (limited to 'pkg/lang/compiler/compiler_test.go') 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 ` -- cgit 1.4.1