aboutsummaryrefslogtreecommitdiff
path: root/build/android/res/layout
ModeNameSize
-rw-r--r--assetcopy.xml804logplain
f='#n7'>7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123
-- test the serialization function


package.path  =  "../?.lua;" .. package.path


ser = require("serialize")


local mock_file = {}
_G.mock_file = mock_file
function mock_file:read(arg)
	if arg == "*l" then
		local l = self.lines[self.pointer or 1]
		self.pointer = (self.pointer or 1) + 1
		return l
	end
end

function mock_file:close()
	return nil
end

function mock_file:write(text)
	self.content = self.content..text
end

function mock_file:create(lines)
	local f = {}
	setmetatable(f, mock_file)
	f.lines = lines or {}
	f.write = self.write
	f.close = self.close
	f.read = self.read
	f.content = ""
	return f
end


local testtable = {
	key = "value",
	[1] = "eins",
	[true] = {
		a = "b",
		c = false,
	},
	["es:cape1"] = "foo:bar",
	["es&ca\npe2"] = "baz&bam\nbim",
	["es&&ca&\npe3"] = "baz&&bam&\nbim",
	["es&:cape4"] = "foo\n:bar"
}
local testser = [[LUA_SER v=1
B1:T
Sa:Sb
Sc:B0
E
Skey:Svalue
Ses&&&&ca&&&npe3:Sbaz&&&&bam&&&nbim
N1:Seins
Ses&&&:cape4:Sfoo&n&:bar
Ses&&ca&npe2:Sbaz&&bam&nbim
Ses&:cape1:Sfoo&:bar
E
END_SER
]]

local function check_write(tb, conf)
	f = mock_file:create()
	ser.write_to_fd(tb, f, conf or {})
	return f.content
end

function string:split()