Fix test to work with lunitx on Lua 5.1

This commit is contained in:
Enno Rehling 2020-05-03 16:52:40 +02:00
parent 04c3052916
commit 6cf6f96fb8
57 changed files with 126 additions and 116 deletions

View file

@ -2,7 +2,10 @@
-- Tests are under scripts/test/e2 and all files must be in scripts/test/e2/init.lua -- Tests are under scripts/test/e2 and all files must be in scripts/test/e2/init.lua
lunit = require('lunit') lunit = require('lunit')
if _VERSION >= 'Lua 5.2' then
module = lunit.module module = lunit.module
end
path = 'scripts' path = 'scripts'
if config.install then if config.install then
path = config.install .. '/' .. path path = config.install .. '/' .. path

View file

@ -2,7 +2,9 @@
-- Tests are under scripts/test/e3 and all files must be in scripts/test/e3/init.lua -- Tests are under scripts/test/e3 and all files must be in scripts/test/e3/init.lua
lunit = require('lunit') lunit = require('lunit')
if _VERSION >= 'Lua 5.2' then
module = lunit.module module = lunit.module
end
path = 'scripts' path = 'scripts'
if config.install then if config.install then
@ -12,7 +14,6 @@ package.path = package.path .. ';' .. path .. '/?.lua;' .. path .. '/?/init.lua'
config.rules = 'e3' config.rules = 'e3'
lunit = require 'lunit'
require 'eressea' require 'eressea'
require 'eressea.path' require 'eressea.path'
require 'eressea.xmlconf' require 'eressea.xmlconf'

View file

@ -1,18 +1,19 @@
-- Basic test without loading XML Config. Test care about needed settings. -- Basic test without loading XML Config. Test care about needed settings.
-- Tests are under scripts/test/ and all files must be in scripts/test/init.lua -- Tests are under scripts/test/ and all files must be in scripts/test/init.lua
lunit = require('lunit')
if _VERSION >= 'Lua 5.2' then
module = lunit.module
end
path = 'scripts' path = 'scripts'
if config.install then if config.install then
path = config.install .. '/' .. path path = config.install .. '/' .. path
end end
package.path = package.path .. ';' .. path .. '/?.lua;' .. path .. '/?/init.lua' package.path = package.path .. ';' .. path .. '/?.lua;' .. path .. '/?/init.lua'
lunit = require 'lunit'
require 'eressea' require 'eressea'
require 'eressea.path' require 'eressea.path'
lunit = require('lunit')
module = lunit.module
require 'tests' require 'tests'
result = lunit.main() result = lunit.main()
return result.errors + result.failed return result.errors + result.failed

View file

@ -1,9 +1,9 @@
local tcname = 'tests.bindings' local tcname = 'tests.bindings'
local lunit = require("lunit") local lunit = require('lunit')
if _VERSION >= 'Lua 5.2' then if _VERSION >= 'Lua 5.2' then
_ENV = module(tcname, 'seeall') _ENV = module(tcname, 'seeall')
else else
module(tcname, 'seeall') module(tcname, lunit.testcase, package.seeall)
end end
local _G = _G local _G = _G

View file

@ -1,9 +1,9 @@
local tcname = 'tests.shared.common' local tcname = 'tests.shared.common'
local lunit = require("lunit") local lunit = require('lunit')
if _VERSION >= 'Lua 5.2' then if _VERSION >= 'Lua 5.2' then
_ENV = module(tcname, 'seeall') _ENV = module(tcname, 'seeall')
else else
module(tcname, 'seeall') module(tcname, lunit.testcase, package.seeall)
end end
local function _test_create_ship(r) local function _test_create_ship(r)

View file

@ -1,9 +1,9 @@
local tcname = 'tests.shared.config' local tcname = 'tests.shared.config'
local lunit = require("lunit") local lunit = require('lunit')
if _VERSION >= 'Lua 5.2' then if _VERSION >= 'Lua 5.2' then
_ENV = module(tcname, 'seeall') _ENV = module(tcname, 'seeall')
else else
module(tcname, 'seeall') module(tcname, lunit.testcase, package.seeall)
end end
function setup() function setup()

View file

@ -1,9 +1,9 @@
local tcname = 'tests.e2.adamantium' local tcname = 'tests.e2.adamantium'
local lunit = require("lunit") local lunit = require('lunit')
if _VERSION >= 'Lua 5.2' then if _VERSION >= 'Lua 5.2' then
_ENV = module(tcname, 'seeall') _ENV = module(tcname, 'seeall')
else else
module(tcname, 'seeall') module(tcname, lunit.testcase, package.seeall)
end end
function setup() function setup()

View file

@ -1,9 +1,9 @@
local tcname = 'tests.e2.allies' local tcname = 'tests.e2.allies'
local lunit = require("lunit") local lunit = require('lunit')
if _VERSION >= 'Lua 5.2' then if _VERSION >= 'Lua 5.2' then
_ENV = module(tcname, 'seeall') _ENV = module(tcname, 'seeall')
else else
module(tcname, 'seeall') module(tcname, lunit.testcase, package.seeall)
end end
function setup() function setup()

View file

@ -1,9 +1,9 @@
local tcname = 'tests.e2.astral' local tcname = 'tests.e2.astral'
local lunit = require("lunit") local lunit = require('lunit')
if _VERSION >= 'Lua 5.2' then if _VERSION >= 'Lua 5.2' then
_ENV = module(tcname, 'seeall') _ENV = module(tcname, 'seeall')
else else
module(tcname, 'seeall') module(tcname, lunit.testcase, package.seeall)
end end
function setup() function setup()

View file

@ -1,9 +1,9 @@
local tcname = 'tests.e2.buildings' local tcname = 'tests.e2.buildings'
local lunit = require("lunit") local lunit = require('lunit')
if _VERSION >= 'Lua 5.2' then if _VERSION >= 'Lua 5.2' then
_ENV = module(tcname, 'seeall') _ENV = module(tcname, 'seeall')
else else
module(tcname, 'seeall') module(tcname, lunit.testcase, package.seeall)
end end
function setup() function setup()

View file

@ -1,9 +1,9 @@
local tcname = 'tests.e2.carts' local tcname = 'tests.e2.carts'
local lunit = require("lunit") local lunit = require('lunit')
if _VERSION >= 'Lua 5.2' then if _VERSION >= 'Lua 5.2' then
_ENV = module(tcname, 'seeall') _ENV = module(tcname, 'seeall')
else else
module(tcname, 'seeall') module(tcname, lunit.testcase, package.seeall)
end end
function setup() function setup()

View file

@ -1,9 +1,9 @@
local tcname = 'tests.e2.destroy' local tcname = 'tests.e2.destroy'
local lunit = require("lunit") local lunit = require('lunit')
if _VERSION >= 'Lua 5.2' then if _VERSION >= 'Lua 5.2' then
_ENV = module(tcname, 'seeall') _ENV = module(tcname, 'seeall')
else else
module(tcname, 'seeall') module(tcname, lunit.testcase, package.seeall)
end end
function setup() function setup()

View file

@ -1,9 +1,9 @@
local tcname = 'tests.e2.features' local tcname = 'tests.e2.features'
local lunit = require("lunit") local lunit = require('lunit')
if _VERSION >= 'Lua 5.2' then if _VERSION >= 'Lua 5.2' then
_ENV = module(tcname, 'seeall') _ENV = module(tcname, 'seeall')
else else
module(tcname, 'seeall') module(tcname, lunit.testcase, package.seeall)
end end
function setup() function setup()

View file

@ -1,9 +1,9 @@
local tcname = 'tests.e2.guard' local tcname = 'tests.e2.guard'
local lunit = require("lunit") local lunit = require('lunit')
if _VERSION >= 'Lua 5.2' then if _VERSION >= 'Lua 5.2' then
_ENV = module(tcname, 'seeall') _ENV = module(tcname, 'seeall')
else else
module(tcname, 'seeall') module(tcname, lunit.testcase, package.seeall)
end end
function setup() function setup()

View file

@ -1,9 +1,9 @@
local tcname = 'tests.e2.insects' local tcname = 'tests.e2.insects'
local lunit = require("lunit") local lunit = require('lunit')
if _VERSION >= 'Lua 5.2' then if _VERSION >= 'Lua 5.2' then
_ENV = module(tcname, 'seeall') _ENV = module(tcname, 'seeall')
else else
module(tcname, 'seeall') module(tcname, lunit.testcase, package.seeall)
end end
function setup() function setup()

View file

@ -1,9 +1,9 @@
local tcname = 'tests.e2.items' local tcname = 'tests.e2.items'
local lunit = require("lunit") local lunit = require('lunit')
if _VERSION >= 'Lua 5.2' then if _VERSION >= 'Lua 5.2' then
_ENV = module(tcname, 'seeall') _ENV = module(tcname, 'seeall')
else else
module(tcname, 'seeall') module(tcname, lunit.testcase, package.seeall)
end end
function setup() function setup()

View file

@ -1,9 +1,9 @@
local tcname = 'tests.e2.movement' local tcname = 'tests.e2.movement'
local lunit = require("lunit") local lunit = require('lunit')
if _VERSION >= 'Lua 5.2' then if _VERSION >= 'Lua 5.2' then
_ENV = module(tcname, 'seeall') _ENV = module(tcname, 'seeall')
else else
module(tcname, 'seeall') module(tcname, lunit.testcase, package.seeall)
end end
function setup() function setup()

View file

@ -1,9 +1,9 @@
local tcname = 'tests.e2.production' local tcname = 'tests.e2.production'
local lunit = require("lunit") local lunit = require('lunit')
if _VERSION >= 'Lua 5.2' then if _VERSION >= 'Lua 5.2' then
_ENV = module(tcname, 'seeall') _ENV = module(tcname, 'seeall')
else else
module(tcname, 'seeall') module(tcname, lunit.testcase, package.seeall)
end end
function setup() function setup()

View file

@ -1,9 +1,9 @@
local tcname = 'tests.e2.quit' local tcname = 'tests.e2.quit'
local lunit = require("lunit") local lunit = require('lunit')
if _VERSION >= 'Lua 5.2' then if _VERSION >= 'Lua 5.2' then
_ENV = module(tcname, 'seeall') _ENV = module(tcname, 'seeall')
else else
module(tcname, 'seeall') module(tcname, lunit.testcase, package.seeall)
end end
function test_quit_faction() function test_quit_faction()

View file

@ -1,9 +1,9 @@
local tcname = 'tests.e2.shiplanding' local tcname = 'tests.e2.shiplanding'
local lunit = require("lunit") local lunit = require('lunit')
if _VERSION >= 'Lua 5.2' then if _VERSION >= 'Lua 5.2' then
_ENV = module(tcname, 'seeall') _ENV = module(tcname, 'seeall')
else else
module(tcname, 'seeall') module(tcname, lunit.testcase, package.seeall)
end end
function setup() function setup()

View file

@ -1,9 +1,9 @@
local tcname = 'tests.e2.ships' local tcname = 'tests.e2.ships'
local lunit = require("lunit") local lunit = require('lunit')
if _VERSION >= 'Lua 5.2' then if _VERSION >= 'Lua 5.2' then
_ENV = module(tcname, 'seeall') _ENV = module(tcname, 'seeall')
else else
module(tcname, 'seeall') module(tcname, lunit.testcase, package.seeall)
end end
function setup() function setup()

View file

@ -1,9 +1,9 @@
local tcname = 'tests.e2.spells' local tcname = 'tests.e2.spells'
local lunit = require("lunit") local lunit = require('lunit')
if _VERSION >= 'Lua 5.2' then if _VERSION >= 'Lua 5.2' then
_ENV = module(tcname, 'seeall') _ENV = module(tcname, 'seeall')
else else
module(tcname, 'seeall') module(tcname, lunit.testcase, package.seeall)
end end
function setup() function setup()

View file

@ -1,9 +1,9 @@
local tcname = 'tests.e2.stealth' local tcname = 'tests.e2.stealth'
local lunit = require("lunit") local lunit = require('lunit')
if _VERSION >= 'Lua 5.2' then if _VERSION >= 'Lua 5.2' then
_ENV = module(tcname, 'seeall') _ENV = module(tcname, 'seeall')
else else
module(tcname, 'seeall') module(tcname, lunit.testcase, package.seeall)
end end
local f local f

View file

@ -1,9 +1,9 @@
local tcname = 'tests.e2.trees' local tcname = 'tests.e2.trees'
local lunit = require("lunit") local lunit = require('lunit')
if _VERSION >= 'Lua 5.2' then if _VERSION >= 'Lua 5.2' then
_ENV = module(tcname, 'seeall') _ENV = module(tcname, 'seeall')
else else
module(tcname, 'seeall') module(tcname, lunit.testcase, package.seeall)
end end
function setup() function setup()

View file

@ -1,9 +1,9 @@
local tcname = 'tests.e2.trolls' local tcname = 'tests.e2.trolls'
local lunit = require("lunit") local lunit = require('lunit')
if _VERSION >= 'Lua 5.2' then if _VERSION >= 'Lua 5.2' then
_ENV = module(tcname, 'seeall') _ENV = module(tcname, 'seeall')
else else
module(tcname, 'seeall') module(tcname, lunit.testcase, package.seeall)
end end
function setup() function setup()

View file

@ -1,9 +1,9 @@
local tcname = 'tests.e2.undead' local tcname = 'tests.e2.undead'
local lunit = require("lunit") local lunit = require('lunit')
if _VERSION >= 'Lua 5.2' then if _VERSION >= 'Lua 5.2' then
_ENV = module(tcname, 'seeall') _ENV = module(tcname, 'seeall')
else else
module(tcname, 'seeall') module(tcname, lunit.testcase, package.seeall)
end end
function setup() function setup()

View file

@ -1,9 +1,9 @@
local tcname = 'tests.e3.buildings' local tcname = 'tests.e3.buildings'
local lunit = require("lunit") local lunit = require('lunit')
if _VERSION >= 'Lua 5.2' then if _VERSION >= 'Lua 5.2' then
_ENV = module(tcname, 'seeall') _ENV = module(tcname, 'seeall')
else else
module(tcname, 'seeall') module(tcname, lunit.testcase, package.seeall)
end end
function setup() function setup()

View file

@ -1,9 +1,9 @@
local tcname = 'tests.e3.items' local tcname = 'tests.e3.items'
local lunit = require("lunit") local lunit = require('lunit')
if _VERSION >= 'Lua 5.2' then if _VERSION >= 'Lua 5.2' then
_ENV = module(tcname, 'seeall') _ENV = module(tcname, 'seeall')
else else
module(tcname, 'seeall') module(tcname, lunit.testcase, package.seeall)
end end
function setup() function setup()

View file

@ -1,9 +1,9 @@
local tcname = 'tests.e3.morale' local tcname = 'tests.e3.morale'
local lunit = require("lunit") local lunit = require('lunit')
if _VERSION >= 'Lua 5.2' then if _VERSION >= 'Lua 5.2' then
_ENV = module(tcname, 'seeall') _ENV = module(tcname, 'seeall')
else else
module(tcname, 'seeall') module(tcname, lunit.testcase, package.seeall)
end end
function setup() function setup()

View file

@ -1,9 +1,9 @@
local tcname = 'tests.e3.parser' local tcname = 'tests.e3.parser'
local lunit = require("lunit") local lunit = require('lunit')
if _VERSION >= 'Lua 5.2' then if _VERSION >= 'Lua 5.2' then
_ENV = module(tcname, 'seeall') _ENV = module(tcname, 'seeall')
else else
module(tcname, 'seeall') module(tcname, lunit.testcase, package.seeall)
end end
function setup() function setup()

View file

@ -1,9 +1,9 @@
local tcname = 'tests.e3.production' local tcname = 'tests.e3.production'
local lunit = require("lunit") local lunit = require('lunit')
if _VERSION >= 'Lua 5.2' then if _VERSION >= 'Lua 5.2' then
_ENV = module(tcname, 'seeall') _ENV = module(tcname, 'seeall')
else else
module(tcname, 'seeall') module(tcname, lunit.testcase, package.seeall)
end end
function setup() function setup()

View file

@ -1,9 +1,9 @@
local tcname = 'tests.e3.rules' local tcname = 'tests.e3.rules'
local lunit = require("lunit") local lunit = require('lunit')
if _VERSION >= 'Lua 5.2' then if _VERSION >= 'Lua 5.2' then
_ENV = module(tcname, 'seeall') _ENV = module(tcname, 'seeall')
else else
module(tcname, 'seeall') module(tcname, lunit.testcase, package.seeall)
end end
local settings local settings

View file

@ -1,9 +1,9 @@
local tcname = 'tests.e3.e2spells' local tcname = 'tests.e3.e2spells'
local lunit = require("lunit") local lunit = require('lunit')
if _VERSION >= 'Lua 5.2' then if _VERSION >= 'Lua 5.2' then
_ENV = module(tcname, 'seeall') _ENV = module(tcname, 'seeall')
else else
module(tcname, 'seeall') module(tcname, lunit.testcase, package.seeall)
end end
local r, f, u local r, f, u

View file

@ -1,9 +1,9 @@
local tcname = 'tests.e3.spells' local tcname = 'tests.e3.spells'
local lunit = require("lunit") local lunit = require('lunit')
if _VERSION >= 'Lua 5.2' then if _VERSION >= 'Lua 5.2' then
_ENV = module(tcname, 'seeall') _ENV = module(tcname, 'seeall')
else else
module(tcname, 'seeall') module(tcname, lunit.testcase, package.seeall)
end end
function setup() function setup()

View file

@ -1,9 +1,9 @@
local tcname = 'tests.e3.stealth' local tcname = 'tests.e3.stealth'
local lunit = require("lunit") local lunit = require('lunit')
if _VERSION >= 'Lua 5.2' then if _VERSION >= 'Lua 5.2' then
_ENV = module(tcname, 'seeall') _ENV = module(tcname, 'seeall')
else else
module(tcname, 'seeall') module(tcname, lunit.testcase, package.seeall)
end end
local f local f

View file

@ -1,9 +1,9 @@
local tcname = 'tests.shared.economy' local tcname = 'tests.shared.economy'
local lunit = require("lunit") local lunit = require('lunit')
if _VERSION >= 'Lua 5.2' then if _VERSION >= 'Lua 5.2' then
_ENV = module(tcname, 'seeall') _ENV = module(tcname, 'seeall')
else else
module(tcname, 'seeall') module(tcname, lunit.testcase, package.seeall)
end end
function setup() function setup()

View file

@ -1,8 +1,9 @@
local lunit = require("lunit") local tcname = 'tests.faction'
local lunit = require('lunit')
if _VERSION >= 'Lua 5.2' then if _VERSION >= 'Lua 5.2' then
_ENV = module("tests.faction", 'seeall') _ENV = module(tcname, 'seeall')
else else
module("tests.faction", 'seeall') module(tcname, lunit.testcase, package.seeall)
end end
local f local f

View file

@ -1,9 +1,9 @@
local tcname = 'tests.hunger' local tcname = 'tests.hunger'
local lunit = require("lunit") local lunit = require('lunit')
if _VERSION >= 'Lua 5.2' then if _VERSION >= 'Lua 5.2' then
_ENV = module(tcname, 'seeall') _ENV = module(tcname, 'seeall')
else else
module(tcname, 'seeall') module(tcname, lunit.testcase, package.seeall)
end end
function setup() function setup()

View file

@ -3,7 +3,7 @@ local lunit = require("lunit")
if _VERSION >= 'Lua 5.2' then if _VERSION >= 'Lua 5.2' then
_ENV = module(tcname, 'seeall') _ENV = module(tcname, 'seeall')
else else
module(tcname, 'seeall') module(tcname, lunit.testcase, package.seeall)
end end
function setup() function setup()

View file

@ -1,8 +1,9 @@
local lunit = require("lunit") local tcname = 'tests.laws'
local lunit = require('lunit')
if _VERSION >= 'Lua 5.2' then if _VERSION >= 'Lua 5.2' then
_ENV = module("tests.laws", 'seeall') _ENV = module(tcname, 'seeall')
else else
module("tests.laws", 'seeall') module(tcname, lunit.testcase, package.seeall)
end end
function setup() function setup()

View file

@ -1,8 +1,9 @@
local lunit = require("lunit") local tcname = 'tests.locale'
local lunit = require('lunit')
if _VERSION >= 'Lua 5.2' then if _VERSION >= 'Lua 5.2' then
_ENV = module("tests.locale", 'seeall') _ENV = module(tcname, 'seeall')
else else
module("tests.locale", 'seeall') module(tcname, lunit.testcase, package.seeall)
end end
function setup() function setup()

View file

@ -1,9 +1,9 @@
local tcname = 'tests.shared.magicbag' local tcname = 'tests.shared.magicbag'
local lunit = require("lunit") local lunit = require('lunit')
if _VERSION >= 'Lua 5.2' then if _VERSION >= 'Lua 5.2' then
_ENV = module(tcname, 'seeall') _ENV = module(tcname, 'seeall')
else else
module(tcname, 'seeall') module(tcname, lunit.testcase, package.seeall)
end end
local u local u

View file

@ -1,8 +1,9 @@
local tcname = 'tests.movement'
local lunit = require("lunit") local lunit = require("lunit")
if _VERSION >= 'Lua 5.2' then if _VERSION >= 'Lua 5.2' then
_ENV = module("tests.movement", 'seeall') _ENV = module(tcname , 'seeall')
else else
module("tests.movement", 'seeall') module(tcname, lunit.testcase, package.seeall)
end end
function setup() function setup()

View file

@ -1,9 +1,9 @@
local tcname = 'tests.shared.orders' local tcname = 'tests.shared.orders'
local lunit = require("lunit") local lunit = require("lunit")
if _VERSION >= 'Lua 5.2' then if _VERSION >= 'Lua 5.2' then
_ENV = module(tcname, 'seeall') _ENV = module(tcname , 'seeall')
else else
module(tcname, 'seeall') module(tcname, lunit.testcase, package.seeall)
end end
local _G = _G local _G = _G

View file

@ -1,9 +1,9 @@
local tcname = 'tests.shared.parser' local tcname = 'tests.shared.parser'
local lunit = require("lunit") local lunit = require('lunit')
if _VERSION >= 'Lua 5.2' then if _VERSION >= 'Lua 5.2' then
_ENV = module(tcname, 'seeall') _ENV = module(tcname, 'seeall')
else else
module(tcname, 'seeall') module(tcname, lunit.testcase, package.seeall)
end end
function setup() function setup()

View file

@ -1,8 +1,9 @@
local lunit = require("lunit") local tcname = 'tests.pool'
local lunit = require('lunit')
if _VERSION >= 'Lua 5.2' then if _VERSION >= 'Lua 5.2' then
_ENV = module("tests.pool", 'seeall') _ENV = module(tcname, 'seeall')
else else
module("tests.pool", 'seeall') module(tcname, lunit.testcase, package.seeall)
end end
function setup() function setup()

View file

@ -1,9 +1,9 @@
local tcname = 'tests.shared.process' local tcname = 'tests.shared.process'
local lunit = require("lunit") local lunit = require('lunit')
if _VERSION >= 'Lua 5.2' then if _VERSION >= 'Lua 5.2' then
_ENV = module(tcname, 'seeall') _ENV = module(tcname, 'seeall')
else else
module(tcname, 'seeall') module(tcname, lunit.testcase, package.seeall)
end end
local u, r, f local u, r, f

View file

@ -1,9 +1,9 @@
local tcname = 'tests.shared.production' local tcname = 'tests.shared.production'
local lunit = require("lunit") local lunit = require('lunit')
if _VERSION >= 'Lua 5.2' then if _VERSION >= 'Lua 5.2' then
_ENV = module(tcname, 'seeall') _ENV = module(tcname, 'seeall')
else else
module(tcname, 'seeall') module(tcname, lunit.testcase, package.seeall)
end end
function setup() function setup()

View file

@ -1,9 +1,9 @@
local tcname = 'tests.shared.recruit' local tcname = 'tests.shared.recruit'
local lunit = require("lunit") local lunit = require('lunit')
if _VERSION >= 'Lua 5.2' then if _VERSION >= 'Lua 5.2' then
_ENV = module(tcname, 'seeall') _ENV = module(tcname, 'seeall')
else else
module(tcname, 'seeall') module(tcname, lunit.testcase, package.seeall)
end end
function setup() function setup()

View file

@ -1,9 +1,9 @@
local tcname = 'tests.regions' local tcname = 'tests.regions'
local lunit = require("lunit") local lunit = require('lunit')
if _VERSION >= 'Lua 5.2' then if _VERSION >= 'Lua 5.2' then
_ENV = module(tcname, 'seeall') _ENV = module(tcname, 'seeall')
else else
module(tcname, 'seeall') module(tcname, lunit.testcase, package.seeall)
end end
function setup() function setup()

View file

@ -1,9 +1,9 @@
local tcname = 'tests.shared.report' local tcname = 'tests.shared.report'
local lunit = require("lunit") local lunit = require('lunit')
if _VERSION >= 'Lua 5.2' then if _VERSION >= 'Lua 5.2' then
_ENV = module(tcname, 'seeall') _ENV = module(tcname, 'seeall')
else else
module(tcname, 'seeall') module(tcname, lunit.testcase, package.seeall)
end end
function setup() function setup()

View file

@ -1,9 +1,9 @@
local tcname = 'tests.settings' local tcname = 'tests.settings'
local lunit = require("lunit") local lunit = require('lunit')
if _VERSION >= 'Lua 5.2' then if _VERSION >= 'Lua 5.2' then
_ENV = module(tcname, 'seeall') _ENV = module(tcname, 'seeall')
else else
module(tcname, 'seeall') module(tcname, lunit.testcase, package.seeall)
end end
function setup() function setup()

View file

@ -1,9 +1,9 @@
local tcname = 'tests.shared.spells' local tcname = 'tests.shared.spells'
local lunit = require("lunit") local lunit = require('lunit')
if _VERSION >= 'Lua 5.2' then if _VERSION >= 'Lua 5.2' then
_ENV = module(tcname, 'seeall') _ENV = module(tcname, 'seeall')
else else
module(tcname, 'seeall') module(tcname, lunit.testcase, package.seeall)
end end
function setup() function setup()

View file

@ -1,9 +1,9 @@
local tcname = 'tests.shared.storage' local tcname = 'tests.shared.storage'
local lunit = require("lunit") local lunit = require('lunit')
if _VERSION >= 'Lua 5.2' then if _VERSION >= 'Lua 5.2' then
_ENV = module(tcname, 'seeall') _ENV = module(tcname, 'seeall')
else else
module(tcname, 'seeall') module(tcname, lunit.testcase, package.seeall)
end end
function setup() function setup()

View file

@ -1,9 +1,9 @@
local tcname = 'tests.study' local tcname = 'tests.study'
local lunit = require("lunit") local lunit = require('lunit')
if _VERSION >= 'Lua 5.2' then if _VERSION >= 'Lua 5.2' then
_ENV = module(tcname, 'seeall') _ENV = module(tcname, 'seeall')
else else
module(tcname, 'seeall') module(tcname, lunit.testcase, package.seeall)
end end
function setup() function setup()

View file

@ -1,9 +1,9 @@
local tcname = 'tests.shared.undead' local tcname = 'tests.shared.undead'
local lunit = require("lunit") local lunit = require('lunit')
if _VERSION >= 'Lua 5.2' then if _VERSION >= 'Lua 5.2' then
_ENV = module(tcname, 'seeall') _ENV = module(tcname, 'seeall')
else else
module(tcname, 'seeall') module(tcname, lunit.testcase, package.seeall)
end end
function setup() function setup()

View file

@ -1,9 +1,9 @@
local tcname = 'tests.shared.xmas' local tcname = 'tests.shared.xmas'
local lunit = require("lunit") local lunit = require('lunit')
if _VERSION >= 'Lua 5.2' then if _VERSION >= 'Lua 5.2' then
_ENV = module(tcname, 'seeall') _ENV = module(tcname, 'seeall')
else else
module(tcname, 'seeall') module(tcname, lunit.testcase, package.seeall)
end end
function setup() function setup()