Make the module and the tests Lua 5.3 compatible

This commit is contained in:
mpeterv
2015-09-10 22:15:42 +03:00
parent 916cc42e0b
commit af68f61c50
2 changed files with 4 additions and 2 deletions

View File

@@ -4401,10 +4401,10 @@ local function run_tests()
-- Do any <pre></pre> sequences in s1 and s2 match up perfectly? -- Do any <pre></pre> sequences in s1 and s2 match up perfectly?
local function pre_equal(s1, s2) local function pre_equal(s1, s2)
local pre = {} local pre = {}
for p in s1:gfind("<pre>.-</pre>") do for p in s1:gmatch("<pre>.-</pre>") do
pre[#pre+1] = p pre[#pre+1] = p
end end
for p in s2:gfind("<pre>.-</pre>") do for p in s2:gmatch("<pre>.-</pre>") do
if p ~= pre[1] then return false end if p ~= pre[1] then return false end
table.remove(pre, 1) table.remove(pre, 1)
end end

View File

@@ -120,6 +120,8 @@ THE SOFTWARE.
-- Utility functions -- Utility functions
---------------------------------------------------------------------- ----------------------------------------------------------------------
local unpack = table.unpack or unpack
-- Locks table t from changes, writes an error if someone attempts to change the table. -- Locks table t from changes, writes an error if someone attempts to change the table.
-- This is useful for detecting variables that have "accidently" been made global. Something -- This is useful for detecting variables that have "accidently" been made global. Something
-- I tend to do all too much. -- I tend to do all too much.