Fix sloppy errors (forgot to pass an argument, haserror -> has_error)

This commit is contained in:
Robin Wellner 2016-02-15 15:24:07 +01:00
parent bf4425aac8
commit 0d0bb54405
2 changed files with 3 additions and 3 deletions

View File

@ -235,7 +235,7 @@ local function deserialize_value(buffer, seen)
return v
elseif t == 241 then
--long resource
local idx = reserve_seen()
local idx = reserve_seen(seen)
local value = resource_registry[deserialize_value(buffer, seen)]
seen[idx] = value
return value

View File

@ -149,9 +149,9 @@ describe("bitser", function()
bitser.unregister("temp_resource_or_whatever")
end)
it("cannot serialize functions", function()
assert.haserror(function() bitser.dumps(function() end) end, "cannot serialize type function")
assert.has_error(function() bitser.dumps(function() end) end, "cannot serialize type function")
end)
it("cannot serialize unsupported class libraries without explicit deserializer", function()
assert.haserror(function() bitser.registerClass('Horse', {mane = 'majestic'}) end, "no deserializer given for unsupported class library")
assert.has_error(function() bitser.registerClass('Horse', {mane = 'majestic'}) end, "no deserializer given for unsupported class library")
end)
end)