From 3683436dbeba1172f1ca6507e20001b165f73d7e Mon Sep 17 00:00:00 2001 From: Kampfkarren Date: Thu, 28 Jul 2022 17:33:10 -0700 Subject: [PATCH] Explicit bytecode test --- tests/Compiler.test.cpp | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/tests/Compiler.test.cpp b/tests/Compiler.test.cpp index 17e37f78..0fc0c8cb 100644 --- a/tests/Compiler.test.cpp +++ b/tests/Compiler.test.cpp @@ -1285,15 +1285,24 @@ TEST_CASE("InterpStringRegisterCleanup") CHECK_EQ( "\n" + compileFunction0(R"( local a, b, c = nil, "um", "uh oh" - a = ("foo%*"):format("bar") + a = `foo{"bar"}` print(a) )"), - "\n" + compileFunction0(R"( - local a, b, c = nil, "um", "uh oh" - a = `foo{"bar"}` - print(a) - )") + R"( +LOADNIL R0 +LOADK R1 K0 +LOADK R2 K1 +LOADK R3 K2 +LOADK R5 K3 +NAMECALL R3 R3 K4 +CALL R3 2 1 +MOVE R0 R3 +GETIMPORT R3 6 +MOVE R4 R0 +CALL R3 1 0 +RETURN R0 0 +)" ); }