server/scripts/tests/locale.lua

22 lines
503 B
Lua
Raw Permalink Normal View History

local tcname = 'tests.locale'
local lunit = require('lunit')
2020-04-19 21:35:48 +02:00
if _VERSION >= 'Lua 5.2' then
_ENV = module(tcname, 'seeall')
2020-04-19 21:35:48 +02:00
else
module(tcname, lunit.testcase, package.seeall)
2020-04-19 21:35:48 +02:00
end
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