summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorBenoit Giannangeli <giann008@gmail.com>2017-03-24 16:56:31 +0100
committerBenoit Giannangeli <giann008@gmail.com>2017-03-24 16:56:31 +0100
commit8871373cea55df0374ed0d4da9cd21f2fb08fe09 (patch)
tree7695a5e18b7505424552c281f66503b242f9b691 /tests
parent7af8347dbb7a8c3a09d2aebccd5f96384a7c55c3 (diff)
downloadfengari-8871373cea55df0374ed0d4da9cd21f2fb08fe09.tar.gz
fengari-8871373cea55df0374ed0d4da9cd21f2fb08fe09.tar.bz2
fengari-8871373cea55df0374ed0d4da9cd21f2fb08fe09.zip
%c put the actual value in the string array
Diffstat (limited to 'tests')
-rw-r--r--tests/single.lua5
1 files changed, 5 insertions, 0 deletions
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")