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 20:19:35 +0000
committerMel <einebeere@gmail.com>2022-08-16 20:19:35 +0000
commit51eb7626b788dc031c53016f203a54a2af762d9e (patch)
tree7213d2dfc47308a79963853aa6f964d8d6d41005 /pkg/lang/compiler/compiler_test.go
parent64d438c91ace51bfda7bff50d381b62f5785f72a (diff)
downloadjinx-51eb7626b788dc031c53016f203a54a2af762d9e.tar.zst
jinx-51eb7626b788dc031c53016f203a54a2af762d9e.zip
Add drop after adding element to array literal
Diffstat (limited to 'pkg/lang/compiler/compiler_test.go')
-rw-r--r--pkg/lang/compiler/compiler_test.go8
1 files changed, 8 insertions, 0 deletions
diff --git a/pkg/lang/compiler/compiler_test.go b/pkg/lang/compiler/compiler_test.go
index 9e05230..e40d98e 100644
--- a/pkg/lang/compiler/compiler_test.go
+++ b/pkg/lang/compiler/compiler_test.go
@@ -127,16 +127,20 @@ func TestArrayLit(t *testing.T) {
 	get_member "push"
 	push_int 1
 	call 1
+	drop 1
 
 	get_local 0
 	get_member "push"
 	push_int 2
 	call 1
+	drop 1
 
 	get_local 0
 	get_member "push"
 	push_int 3
 	call 1
+	drop 1
+
 	halt
 	`
 
@@ -372,21 +376,25 @@ func TestForIn(t *testing.T) {
 	get_member "push"
 	push_int 1
 	call 1
+	drop 1
 
 	get_local 0
 	get_member "push"
 	push_int 2
 	call 1
+	drop 1
 
 	get_local 0
 	get_member "push"
 	push_int 3
 	call 1
+	drop 1
 
 	get_local 0
 	get_member "push"
 	push_string "oops"
 	call 1
+	drop 1
 
 	push_int 0
 	push_null