From cfe339f994f381a606972d44d3abe3915da7f0d6 Mon Sep 17 00:00:00 2001 From: Kampfkarren Date: Wed, 27 Jul 2022 22:47:47 -0700 Subject: [PATCH] String to make sure interp strings with no expressions are compiled as strings --- tests/Compiler.test.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/tests/Compiler.test.cpp b/tests/Compiler.test.cpp index c1917638..907d6052 100644 --- a/tests/Compiler.test.cpp +++ b/tests/Compiler.test.cpp @@ -1234,6 +1234,13 @@ RETURN R0 0 )"); } +TEST_CASE("InterpStringWithNoExpressions") +{ + ScopedFastFlag sff{"LuauInterpolatedStringBaseSupport", true}; + + CHECK_EQ(compileFunction0(R"(return "hello")"), compileFunction0("return `hello`")); +} + TEST_CASE("ConstantFoldArith") { CHECK_EQ("\n" + compileFunction0("return 10 + 2"), R"( @@ -2386,7 +2393,7 @@ TEST_CASE("DebugLineInfoRepeatUntil") local f = 0 repeat f += 1 - if f == 1 then + if f == 1 then print(f) else f = 0