make all tests use the new lua API

This commit is contained in:
Enno Rehling 2012-06-17 02:59:56 +02:00
parent 3f2e46c008
commit 619e84d0f7
4 changed files with 11 additions and 11 deletions

View File

@ -3,7 +3,7 @@ require "lunit"
module("tests.e3.castles", package.seeall, lunit.testcase )
function setup()
free_game()
eressea.free_game()
end
function test_small_castles()

View File

@ -3,8 +3,8 @@ require "lunit"
module("tests.e3.e3features", package.seeall, lunit.testcase)
function setup()
free_game()
settings.set("rules.economy.food", "0")
eressea.free_game()
eressea.settings.set("rules.economy.food", "0")
end
function test_no_stealth()
@ -103,7 +103,7 @@ function test_xmastree()
local r
r = use_tree("ocean")
assert_equal(0, r:get_resource("tree"))
free_game()
eressea.free_game()
r = use_tree("plain")
assert_equal(10, r:get_resource("tree"))
end
@ -272,7 +272,7 @@ function test_market()
for i = 0, 5 do
local rn = r:next(i)
end
process.markets()
eressea.process.markets()
u:add_item("money", -u:get_item("money")) -- now we only have herbs
local len = 0
for i in u.items do
@ -415,7 +415,7 @@ function test_canoe_passes_through_land()
end
function test_give_50_percent_of_money()
settings.set("rules.economy.food", "4")
eressea.settings.set("rules.economy.food", "4")
local r = region.create(0, 0, "plain")
local u1 = unit.create(faction.create("noreply@eressea.de", "human", "de"), r, 1)
local u2 = unit.create(faction.create("noreply@eressea.de", "orc", "de"), r, 1)

View File

@ -3,7 +3,7 @@ require "lunit"
module("tests.e3.morale", package.seeall, lunit.testcase )
function setup()
free_game()
eressea.free_game()
end
function test_when_owner_returns_morale_drops_only_2()

View File

@ -6,8 +6,8 @@ local f
local u
function setup()
free_game()
settings.set("rules.economy.food", "4")
eressea.free_game()
eressea.settings.set("rules.economy.food", "4")
local r = region.create(0,0, "plain")
f = faction.create("stealthy@eressea.de", "human", "de")
@ -19,7 +19,7 @@ function test_stealth_faction_on()
u:clear_orders()
u:add_order("TARNEN PARTEI")
settings.set("rules.stealth.faction", 1)
eressea.settings.set("rules.stealth.faction", 1)
process_orders()
assert_not_match("Partei", report.report_unit(u, f))
assert_match("anonym", report.report_unit(u, f))
@ -29,7 +29,7 @@ function test_stealth_faction_off()
u:clear_orders()
u:add_order("TARNEN PARTEI")
settings.set("rules.stealth.faction", 0)
eressea.settings.set("rules.stealth.faction", 0)
process_orders()
assert_match("Partei", report.report_unit(u, f))
assert_not_match("anonym", report.report_unit(u, f))