From d6ac0e26361b1a4b3bfd9d0a50a484d989dbf4a0 Mon Sep 17 00:00:00 2001 From: Robin Wellner Date: Tue, 23 Feb 2016 14:37:22 +0100 Subject: [PATCH] I hope it'll recognise the global now... --- spec/bitser_spec.lua | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/spec/bitser_spec.lua b/spec/bitser_spec.lua index a14b124..437b410 100644 --- a/spec/bitser_spec.lua +++ b/spec/bitser_spec.lua @@ -1,14 +1,5 @@ -local bitser = require 'bitser' local ffi = require 'ffi' -local function serdeser(value) - return bitser.loads(bitser.dumps(value)) -end - -local function test_serdeser(value) - assert.are.same(serdeser(value), value) -end - love = {filesystem = {newFileData = function() return {getPointer = function() local buf = ffi.new("uint8_t[?]", #love.s) @@ -17,10 +8,20 @@ love = {filesystem = {newFileData = function() end, getSize = function() return #love.s end} -end, write = function(s) +end, write = function(fname, s) love.s = s end}} +local bitser = require 'bitser' + +local function serdeser(value) + return bitser.loads(bitser.dumps(value)) +end + +local function test_serdeser(value) + assert.are.same(serdeser(value), value) +end + describe("bitser", function() it("serializes simple values", function() test_serdeser(true)