2020-05-03 16:52:40 +02:00
|
|
|
local tcname = 'tests.locale'
|
|
|
|
local lunit = require('lunit')
|
2020-04-19 21:35:48 +02:00
|
|
|
if _VERSION >= 'Lua 5.2' then
|
2020-05-03 16:52:40 +02:00
|
|
|
_ENV = module(tcname, 'seeall')
|
2020-04-19 21:35:48 +02:00
|
|
|
else
|
2020-05-03 16:52:40 +02:00
|
|
|
module(tcname, lunit.testcase, package.seeall)
|
2020-04-19 21:35:48 +02:00
|
|
|
end
|
2014-08-07 13:19:19 +02:00
|
|
|
|
|
|
|
function setup()
|
|
|
|
eressea.free_game()
|
|
|
|
end
|
|
|
|
|
|
|
|
function test_get_set()
|
|
|
|
local loc = "en"
|
|
|
|
assert_not_nil(eressea.locale)
|
|
|
|
eressea.locale.create(loc)
|
|
|
|
assert_equal(nil, eressea.locale.get(loc, "move"))
|
|
|
|
eressea.locale.set(loc, "move", "MOVE")
|
|
|
|
assert_equal("MOVE", eressea.locale.get(loc, "move"))
|
|
|
|
end
|
|
|
|
|