Commit 60da289a authored by François Perrad's avatar François Perrad
Browse files

refactor with _dofile

parent 1be25a8e
......@@ -2,6 +2,7 @@ codes = true
max_line_length = 132
read_globals = {
-- test_assertion (subset of Test.Assertion)
'_dofile',
'_retrieve_progname',
'plan',
'done_testing',
......
......@@ -114,7 +114,7 @@ error_matches(function () local a = true; a[1] = 1; end,
"index")
if has_op53 then
dofile'lexico53/boolean.t'
_dofile'lexico53/boolean.t'
end
done_testing()
......
......@@ -193,7 +193,7 @@ t[print] = true
truthy(t[print])
if has_op53 then
dofile'lexico53/function.t'
_dofile'lexico53/function.t'
end
done_testing()
......
......@@ -114,7 +114,7 @@ error_matches(function () local a = nil; a[1] = 1; end,
"index")
if has_op53 then
dofile'lexico53/nil.t'
_dofile'lexico53/nil.t'
end
done_testing()
......
......@@ -233,7 +233,7 @@ error_matches(function () local a = 3.14; a[1] = 1; end,
"index")
if has_op53 then
dofile'lexico53/number.t'
_dofile'lexico53/number.t'
end
done_testing()
......
......@@ -264,7 +264,7 @@ error_matches(function () a = 'text'; a[1] = 1; end,
"index")
if has_op53 then
dofile'lexico53/string.t'
_dofile'lexico53/string.t'
end
done_testing()
......
......@@ -122,7 +122,7 @@ error_matches(function () t = {}; t[0/0] = 42 end,
"table index is NaN")
if has_op53 then
dofile'lexico53/table.t'
_dofile'lexico53/table.t'
end
done_testing()
......
......@@ -122,7 +122,7 @@ t[co] = true
truthy(t[co])
if has_op53 then
dofile'lexico53/thread.t'
_dofile'lexico53/thread.t'
end
done_testing()
......
......@@ -119,7 +119,7 @@ t[u] = true
truthy(t[u])
if has_op53 then
dofile'lexico53/userdata.t'
_dofile'lexico53/userdata.t'
end
done_testing()
......
......@@ -118,19 +118,19 @@ do
end
if _VERSION >= 'Lua 5.2' or jit then
dofile'lexico52/lexico.t'
_dofile'lexico52/lexico.t'
end
if _VERSION >= 'Lua 5.3' or luajit21 then
dofile'lexico53/lexico.t'
_dofile'lexico53/lexico.t'
end
if _VERSION >= 'Lua 5.4' then
dofile'lexico54/lexico.t'
_dofile'lexico54/lexico.t'
end
if jit and pcall(require, 'ffi') then
dofile'lexicojit/lexico.t'
_dofile'lexicojit/lexico.t'
end
done_testing()
......
......@@ -589,7 +589,7 @@ do
end
if has_anno_toclose then
dofile'lexico54/metatable.t'
_dofile'lexico54/metatable.t'
end
done_testing()
......
......@@ -843,7 +843,7 @@ do -- xpcall
end
if jit and pcall(require, 'ffi') then
dofile'lexicojit/basic.t'
_dofile'lexicojit/basic.t'
end
done_testing()
......
......@@ -40,9 +40,9 @@ if not utf8 then
falsy(has_utf8, "no has_utf8")
else
plan'no_plan'
dofile'lexico53/utf8.t'
_dofile'lexico53/utf8.t'
if _VERSION >= 'Lua 5.4' then
dofile'lexico54/utf8.t'
_dofile'lexico54/utf8.t'
end
done_testing()
end
......
......@@ -158,7 +158,7 @@ end
-- thread.exdata
if pcall(require, 'ffi') and (profile.openresty or jit.version:match'moonjit') then
dofile'lexicojit/ext.t'
_dofile'lexicojit/ext.t'
end
done_testing()
......
......@@ -9,6 +9,8 @@
]]
_dofile = _dofile or dofile -- could be defined in profile
function _retrieve_progname ()
local i = 0
while arg[i] do
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment