about summary refs log tree commit diff
path: root/pkg/lang/compiler/compiler_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'pkg/lang/compiler/compiler_test.go')
-rw-r--r--pkg/lang/compiler/compiler_test.go8
1 files changed, 6 insertions, 2 deletions
diff --git a/pkg/lang/compiler/compiler_test.go b/pkg/lang/compiler/compiler_test.go
index b8a6264..07586a6 100644
--- a/pkg/lang/compiler/compiler_test.go
+++ b/pkg/lang/compiler/compiler_test.go
@@ -434,15 +434,17 @@ func TestForIn(t *testing.T) {
 
 func TestSimpleFunction(t *testing.T) {
 	src := `
-	var result = the_meaning_of_life()
-
 	fn the_meaning_of_life() {
 		return 42
 	}
+
+	var result = the_meaning_of_life()
 	`
 
 	expected := `
 	push_function @the_meaning_of_life
+
+	get_local 0
 	call 0
 	halt
 
@@ -466,6 +468,8 @@ func TestFunctionArgs(t *testing.T) {
 	expected := `
 	push_function @add
 	set_arg_count 2
+
+	get_local 0
 	push_int 4
 	push_int 5
 	call 2