From 0d0bb544051b92bf368fe71d50798697638e4d16 Mon Sep 17 00:00:00 2001 From: Robin Wellner Date: Mon, 15 Feb 2016 15:24:07 +0100 Subject: [PATCH] Fix sloppy errors (forgot to pass an argument, haserror -> has_error) --- bitser.lua | 2 +- spec/bitser_spec.lua | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/bitser.lua b/bitser.lua index 89d94a2..f42d3f1 100644 --- a/bitser.lua +++ b/bitser.lua @@ -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 diff --git a/spec/bitser_spec.lua b/spec/bitser_spec.lua index e49369a..d305b7b 100644 --- a/spec/bitser_spec.lua +++ b/spec/bitser_spec.lua @@ -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) \ No newline at end of file