From 245e582eaad5293fc5b8d4620d140a527c3b42c4 Mon Sep 17 00:00:00 2001 From: Benoit Giannangeli Date: Fri, 24 Mar 2017 22:05:29 +0100 Subject: Fixed string.format pattern with '.' --- tests/single.lua | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'tests') diff --git a/tests/single.lua b/tests/single.lua index c87ac7e..8ca9fbb 100644 --- a/tests/single.lua +++ b/tests/single.lua @@ -165,3 +165,8 @@ assert(tonumber(string.format("%f", 10.3)) == 10.3) x = string.format('"%-50s"', 'a') assert(#x == 52) assert(string.sub(x, 1, 4) == '"a ') + +assert(string.format("-%.20s.20s", string.rep("%", 2000)) == + "-"..string.rep("%", 20)..".20s") +assert(string.format('"-%20s.20s"', string.rep("%", 2000)) == + string.format("%q", "-"..string.rep("%", 2000)..".20s")) -- cgit v1.2.3-54-g00ecf