Explicit bytecode test

This commit is contained in:
Kampfkarren 2022-07-28 17:33:10 -07:00
parent ea9d29658c
commit 3683436dbe

View file

@ -1285,15 +1285,24 @@ TEST_CASE("InterpStringRegisterCleanup")
CHECK_EQ( CHECK_EQ(
"\n" + compileFunction0(R"( "\n" + compileFunction0(R"(
local a, b, c = nil, "um", "uh oh" local a, b, c = nil, "um", "uh oh"
a = ("foo%*"):format("bar") a = `foo{"bar"}`
print(a) print(a)
)"), )"),
"\n" + compileFunction0(R"( R"(
local a, b, c = nil, "um", "uh oh" LOADNIL R0
a = `foo{"bar"}` LOADK R1 K0
print(a) 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
)"
); );
} }