1 function readfile(name
)
2 local f
= io
.open(name
, "rb")
3 if not f
then return nil end
9 function similar(s1
, s2
)
10 return string.lower(string.gsub(s1
or "", "%s", "")) ==
11 string.lower(string.gsub(s2
or "", "%s", ""))
19 function compare(input
, output
)
20 local original
= readfile(input
)
21 local recovered
= readfile(output
)
22 if original
~= recovered
then fail("comparison failed")
30 local setglobal = function(table, key
, value
)
31 warn("changed " .. key
)
32 set(table, key
, value
)
36 __newindex
= setglobal