forked from github/server
fixing TARNE PARTEI NUMMER tests
This commit is contained in:
parent
46bc0eb620
commit
b43a89e4ec
1 changed files with 5 additions and 8 deletions
|
@ -19,36 +19,33 @@ end
|
|||
function setup()
|
||||
eressea.game.reset()
|
||||
set_rule('rules.food.flags', '4')
|
||||
set_rule('rules.magic.playerschools', '')
|
||||
|
||||
local r = region.create(0,0, "plain")
|
||||
f = faction.create("stealthy@eressea.de", "human", "de")
|
||||
u = unit.create(f, r, 1)
|
||||
f = faction.create("stealth@eressea.de", "human", "de")
|
||||
unit.create(f, r, 1) -- TARNE PARTEI NUMMER <no> must have a unit in the region
|
||||
end
|
||||
|
||||
function teardown()
|
||||
set_rule('rules.food.flags')
|
||||
set_rule('rules.magic.playerschools')
|
||||
set_rule('rules.stealth.faction')
|
||||
end
|
||||
|
||||
function test_stealth_faction_on()
|
||||
u:clear_orders()
|
||||
u:add_order("TARNEN PARTEI")
|
||||
|
||||
set_rule("rules.stealth.faction", 1)
|
||||
process_orders()
|
||||
assert_not_match("Partei", report.report_unit(u, f))
|
||||
assert_match("anonym", report.report_unit(u, f))
|
||||
end
|
||||
|
||||
function test_stealth_faction_off()
|
||||
function test_stealth_faction_other()
|
||||
u.name = "Enno"
|
||||
u:clear_orders()
|
||||
u:add_order("TARNEN PARTEI")
|
||||
u:add_order("TARNEN PARTEI NUMMER " .. itoa36(f.id))
|
||||
|
||||
set_rule("rules.stealth.faction", 0)
|
||||
process_orders()
|
||||
assert_match("Partei", report.report_unit(u, f))
|
||||
assert_match(itoa36(f.id), report.report_unit(u, f))
|
||||
assert_not_match("anonym", report.report_unit(u, f))
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue