mirror of
https://github.com/gvx/bitser.git
synced 2024-11-11 01:44:21 +00:00
I hope it'll recognise the global now...
This commit is contained in:
parent
95e58fb654
commit
d6ac0e2636
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user