Skip to content

Commit

Permalink
Additional string tests
Browse files Browse the repository at this point in the history
  • Loading branch information
rxi committed Apr 5, 2020
1 parent 2e76cfb commit 6d080a1
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions test/test.lua
Original file line number Diff line number Diff line change
Expand Up @@ -66,10 +66,16 @@ end)


test("strings", function()
local s = ""
assert( s == json.decode( json.encode(s) ) )
local s = "\\"
assert( s == json.decode( json.encode(s) ) )
local s = "Hello world"
assert( s == json.decode( json.encode(s) ) )
local s = "\0 \13 \27"
assert( s == json.decode( json.encode(s) ) )
local s = "\0\r\n\8"
assert( s == json.decode( json.encode(s) ) )
end)


Expand Down

0 comments on commit 6d080a1

Please sign in to comment.