about summary refs log tree commit diff
path: root/pkg/lang/compiler/compiler_test.go
diff options
context:
space:
mode:
authorMel <einebeere@gmail.com>2022-08-16 19:49:59 +0000
committerMel <einebeere@gmail.com>2022-08-16 20:12:20 +0000
commit64d438c91ace51bfda7bff50d381b62f5785f72a (patch)
treeea1b6a23a6ad05c040603dd4d00887332391e197 /pkg/lang/compiler/compiler_test.go
parent8193e5c590177b91b51acd818e8a365ab6845988 (diff)
downloadjinx-64d438c91ace51bfda7bff50d381b62f5785f72a.tar.zst
jinx-64d438c91ace51bfda7bff50d381b62f5785f72a.zip
Ensure correct argument stack order in all cases
Diffstat (limited to 'pkg/lang/compiler/compiler_test.go')
-rw-r--r--pkg/lang/compiler/compiler_test.go7
1 files changed, 3 insertions, 4 deletions
diff --git a/pkg/lang/compiler/compiler_test.go b/pkg/lang/compiler/compiler_test.go
index 725620c..9e05230 100644
--- a/pkg/lang/compiler/compiler_test.go
+++ b/pkg/lang/compiler/compiler_test.go
@@ -457,7 +457,6 @@ func TestSimpleFunction(t *testing.T) {
 }
 
 func TestFunctionArgs(t *testing.T) {
-	// TODO: Are arguments in the correct order?
 	src := `
 	fn add(a, b) {
 		return a + b
@@ -478,8 +477,8 @@ func TestFunctionArgs(t *testing.T) {
 	halt
 
 	@add:
-	get_local 1
 	get_local 0
+	get_local 1
 	add
 	ret
 	`
@@ -581,11 +580,11 @@ func TestType(t *testing.T) {
 		anchor_type
 
 		get_local 2
-		get_local 1
+		get_local 0
 		set_member "name"
 
 		get_local 2
-		get_local 0
+		get_local 1
 		set_member "age"
 
 		get_local 2