Fixed parse_string() to handle "\\" correctly, added tests

This commit is contained in:
rxi
2015-08-19 19:27:52 +01:00
parent 50f4512c2c
commit 7f823abd2e
2 changed files with 9 additions and 4 deletions

View File

@@ -152,6 +152,8 @@ test("decode escape", function()
[ [["\u263a"]] ] = '',
[ [["\ud83d\ude02"]] ] = '😂',
[ [["\r\n\t\\\""]] ] = '\r\n\t\\"',
[ [["\\"]] ] = '\\',
[ [["\\\\"]] ] = '\\\\',
}
for k, v in pairs(t) do
local res = json.decode(k)