From 8c9101ef9018e8122f079c31cdb31e7716ffd4c3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8E=8B=E5=BD=95=E7=A5=A5?= Date: Tue, 19 Dec 2023 18:35:11 +0800 Subject: [PATCH] update test cases --- compiler_test.go | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/compiler_test.go b/compiler_test.go index 077d0adb..5caf2b03 100644 --- a/compiler_test.go +++ b/compiler_test.go @@ -1089,7 +1089,7 @@ func() { intObject(4), compiledFunction(0, 0, tengo.MakeInstruction(parser.OpTrue), - tengo.MakeInstruction(parser.OpJumpFalsy, 9), + tengo.MakeInstruction(parser.OpJumpFalsy, 11), tengo.MakeInstruction(parser.OpConstant, 0), tengo.MakeInstruction(parser.OpReturn, 1), tengo.MakeInstruction(parser.OpConstant, 1), @@ -1123,7 +1123,7 @@ func() { tengo.MakeInstruction(parser.OpGetLocal, 0), tengo.MakeInstruction(parser.OpConstant, 1), tengo.MakeInstruction(parser.OpEqual), - tengo.MakeInstruction(parser.OpJumpFalsy, 19), + tengo.MakeInstruction(parser.OpJumpFalsy, 21), tengo.MakeInstruction(parser.OpConstant, 2), tengo.MakeInstruction(parser.OpReturn, 1), tengo.MakeInstruction(parser.OpConstant, 1), @@ -1156,7 +1156,7 @@ func() { intObject(4), compiledFunction(0, 0, tengo.MakeInstruction(parser.OpTrue), - tengo.MakeInstruction(parser.OpJumpFalsy, 9), + tengo.MakeInstruction(parser.OpJumpFalsy, 11), tengo.MakeInstruction(parser.OpConstant, 0), tengo.MakeInstruction(parser.OpReturn, 1), tengo.MakeInstruction(parser.OpConstant, 1), @@ -1180,7 +1180,7 @@ func() { intObject(123), compiledFunction(0, 0, tengo.MakeInstruction(parser.OpTrue), - tengo.MakeInstruction(parser.OpJumpFalsy, 6), + tengo.MakeInstruction(parser.OpJumpFalsy, 8), tengo.MakeInstruction(parser.OpReturn, 0), tengo.MakeInstruction(parser.OpReturn, 0), tengo.MakeInstruction(parser.OpConstant, 0), @@ -1200,12 +1200,12 @@ if a := 1; a { tengo.MakeInstruction(parser.OpConstant, 0), tengo.MakeInstruction(parser.OpSetGlobal, 0), tengo.MakeInstruction(parser.OpGetGlobal, 0), - tengo.MakeInstruction(parser.OpJumpFalsy, 27), + tengo.MakeInstruction(parser.OpJumpFalsy, 31), tengo.MakeInstruction(parser.OpConstant, 1), tengo.MakeInstruction(parser.OpSetGlobal, 0), tengo.MakeInstruction(parser.OpGetGlobal, 0), tengo.MakeInstruction(parser.OpSetGlobal, 1), - tengo.MakeInstruction(parser.OpJump, 39), + tengo.MakeInstruction(parser.OpJump, 43), tengo.MakeInstruction(parser.OpConstant, 2), tengo.MakeInstruction(parser.OpSetGlobal, 0), tengo.MakeInstruction(parser.OpGetGlobal, 0), @@ -1238,12 +1238,12 @@ func() { tengo.MakeInstruction(parser.OpConstant, 0), tengo.MakeInstruction(parser.OpDefineLocal, 0), tengo.MakeInstruction(parser.OpGetLocal, 0), - tengo.MakeInstruction(parser.OpJumpFalsy, 22), + tengo.MakeInstruction(parser.OpJumpFalsy, 26), tengo.MakeInstruction(parser.OpConstant, 1), tengo.MakeInstruction(parser.OpSetLocal, 0), tengo.MakeInstruction(parser.OpGetLocal, 0), tengo.MakeInstruction(parser.OpDefineLocal, 1), - tengo.MakeInstruction(parser.OpJump, 31), + tengo.MakeInstruction(parser.OpJump, 35), tengo.MakeInstruction(parser.OpConstant, 2), tengo.MakeInstruction(parser.OpSetLocal, 0), tengo.MakeInstruction(parser.OpGetLocal, 0),