From 7fbe3a006c207cc5212116b9f75179a230b80958 Mon Sep 17 00:00:00 2001 From: Kampfkarren Date: Tue, 26 Jul 2022 18:49:50 -0700 Subject: [PATCH] Test string shadow --- tests/conformance/stringinterp.lua | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/tests/conformance/stringinterp.lua b/tests/conformance/stringinterp.lua index d59427f3..52eae5eb 100644 --- a/tests/conformance/stringinterp.lua +++ b/tests/conformance/stringinterp.lua @@ -46,6 +46,11 @@ assertEq(`1 {`2 {`3 {4}`}`}`, "1 2 3 4") local health = 50 assert(`You have {health}% health` == "You have 50% health") --- INTERP TODO: Test with shadowing `string` (both as a string and not) +local function shadowsString(string) + return `Value is {string}` +end + +assertEq(shadowsString("hello"), "Value is hello") +assertEq(shadowsString(1), "Value is 1") return "OK"