mirror of
https://github.com/gvx/bitser.git
synced 2024-11-11 01:44:21 +00:00
Add tests for resources whose name is also used as a string
This commit is contained in:
parent
714a51faed
commit
3b8dae1dde
@ -219,6 +219,18 @@ describe("bitser", function()
|
|||||||
assert.are.equal(serdeser({this = temp_resource}).this, temp_resource)
|
assert.are.equal(serdeser({this = temp_resource}).this, temp_resource)
|
||||||
bitser.unregister("temp_resource_or_whatever")
|
bitser.unregister("temp_resource_or_whatever")
|
||||||
end)
|
end)
|
||||||
|
it("serializes resources with the same name as serialized strings", function()
|
||||||
|
local temp_resource = {}
|
||||||
|
bitser.register('temp', temp_resource)
|
||||||
|
test_serdeser({temp='temp', {temp_resource}})
|
||||||
|
bitser.unregister('temp')
|
||||||
|
end)
|
||||||
|
it("serializes resources with the same long name as serialized strings", function()
|
||||||
|
local temp_resource = {}
|
||||||
|
bitser.register('temp_resource_or_whatever', temp_resource)
|
||||||
|
test_serdeser({temp_resource_or_whatever='temp_resource_or_whatever', {temp_resource}})
|
||||||
|
bitser.unregister('temp_resource_or_whatever')
|
||||||
|
end)
|
||||||
it("cannot serialize functions", function()
|
it("cannot serialize functions", function()
|
||||||
assert.has_error(function() bitser.dumps(function() end) end, "cannot serialize type function")
|
assert.has_error(function() bitser.dumps(function() end) end, "cannot serialize type function")
|
||||||
end)
|
end)
|
||||||
|
Loading…
Reference in New Issue
Block a user