From 619e84d0f7d0a08cdd5cbda6098a546c932c0e92 Mon Sep 17 00:00:00 2001 From: Enno Rehling Date: Sun, 17 Jun 2012 02:59:56 +0200 Subject: [PATCH] make all tests use the new lua API --- scripts/tests/castles.lua | 2 +- scripts/tests/e3a.lua | 10 +++++----- scripts/tests/morale.lua | 2 +- scripts/tests/stealth.lua | 8 ++++---- 4 files changed, 11 insertions(+), 11 deletions(-) diff --git a/scripts/tests/castles.lua b/scripts/tests/castles.lua index 056eede5e..c8c1bc83b 100644 --- a/scripts/tests/castles.lua +++ b/scripts/tests/castles.lua @@ -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() diff --git a/scripts/tests/e3a.lua b/scripts/tests/e3a.lua index 4b11d0888..d114c71ce 100644 --- a/scripts/tests/e3a.lua +++ b/scripts/tests/e3a.lua @@ -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) diff --git a/scripts/tests/morale.lua b/scripts/tests/morale.lua index cb0672ac0..ddbdb9526 100644 --- a/scripts/tests/morale.lua +++ b/scripts/tests/morale.lua @@ -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() diff --git a/scripts/tests/stealth.lua b/scripts/tests/stealth.lua index 4c169e9f8..a5f8cdcb5 100644 --- a/scripts/tests/stealth.lua +++ b/scripts/tests/stealth.lua @@ -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))