From 8871373cea55df0374ed0d4da9cd21f2fb08fe09 Mon Sep 17 00:00:00 2001 From: Benoit Giannangeli Date: Fri, 24 Mar 2017 16:56:31 +0100 Subject: %c put the actual value in the string array --- tests/single.lua | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'tests') diff --git a/tests/single.lua b/tests/single.lua index e3ba2f5..e8d7210 100644 --- a/tests/single.lua +++ b/tests/single.lua @@ -151,3 +151,8 @@ end x = '"ílo"\n\\' assert(string.format('%q%s', x, x) == '"\\"ílo\\"\\\n\\\\""ílo"\n\\') assert(string.format('%q', "\0") == [["\0"]]) +assert(load(string.format('return %q', x))() == x) +x = "\0\1\0023\5\0009" +assert(load(string.format('return %q', x))() == x) +assert(string.format("\0%c\0%c%x\0", string.byte("\xe4"), string.byte("b"), 140) == + "\0\xe4\0b8c\0") -- cgit v1.2.3-70-g09d2