Added support for NaN, inf and -inf to lume.serialize; updated tests

This commit is contained in:
rxi
2015-09-23 19:32:25 +01:00
parent 1559803c70
commit 8627638db0
2 changed files with 10 additions and 1 deletions

View File

@@ -484,6 +484,10 @@ tests["lume.serialize, lume.deserialize"] = function()
local t = { 1, 2, 3, 4, true, false, "cat", "dog", {1, 2, 3} }
local s = lume.serialize(t)
testeq( lume.deserialize(s), t )
testeq( lume.deserialize(lume.serialize(math.huge)), math.huge )
testeq( lume.deserialize(lume.serialize(-math.huge)), -math.huge )
local x = lume.deserialize(lume.serialize(0 / 0)) -- nan
testeq( x ~= x, true )
end
-- lume.split