diff options
author | Benoit Giannangeli <giann008@gmail.com> | 2017-03-24 22:05:29 +0100 |
---|---|---|
committer | Benoit Giannangeli <giann008@gmail.com> | 2017-03-24 22:05:29 +0100 |
commit | 245e582eaad5293fc5b8d4620d140a527c3b42c4 (patch) | |
tree | 1e1286e9843195033cba322377626be50f6ee1c1 /tests/single.lua | |
parent | 6f42ac9cce2ded1f62cf967f42c85b1171678fa1 (diff) | |
download | fengari-245e582eaad5293fc5b8d4620d140a527c3b42c4.tar.gz fengari-245e582eaad5293fc5b8d4620d140a527c3b42c4.tar.bz2 fengari-245e582eaad5293fc5b8d4620d140a527c3b42c4.zip |
Fixed string.format pattern with '.'
Diffstat (limited to 'tests/single.lua')
-rw-r--r-- | tests/single.lua | 5 |
1 files changed, 5 insertions, 0 deletions
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")) |