fix lua tests to not expect numeric values for unit.guard

This commit is contained in:
Enno Rehling 2016-10-31 20:12:19 +01:00
parent 313d988e59
commit a285bd332c
1 changed files with 6 additions and 6 deletions

View File

@ -13,24 +13,24 @@ function test_guard_unarmed()
local r1 = region.create(0, 0, "plain")
local f1 = faction.create("hodor@eressea.de", "human", "de")
local u1 = unit.create(f1, r1, 1)
assert_equal(nil, u1.guard)
assert_equal(false, u1.guard)
u1:clear_orders()
u1:add_order("BEWACHE")
process_orders()
assert_equal(nil, u1.guard)
assert_equal(false, u1.guard)
end
function test_guard_armed()
local r1 = region.create(0, 0, "plain")
local f1 = faction.create("hodor@eressea.de", "human", "de")
local u1 = unit.create(f1, r1, 1)
assert_equal(nil, u1.guard)
assert_equal(false, u1.guard)
u1:add_item("sword", 1)
u1:set_skill("melee", 2)
u1:clear_orders()
u1:add_order("BEWACHE")
process_orders()
assert_equal(249, u1.guard)
assert_equal(true, u1.guard)
end
function test_guard_allows_move_after_combat() -- bug 1493
@ -47,7 +47,7 @@ function test_guard_allows_move_after_combat() -- bug 1493
u1:clear_orders()
u1:add_order("BEWACHE")
process_orders()
assert_equal(249, u1.guard)
assert_equal(true, u1.guard)
u1:clear_orders()
u1:add_order("NACH O")
u1:add_order("ATTACKIERE " .. itoa36(u2.id))
@ -67,7 +67,7 @@ function test_no_guard_no_move_after_combat() -- bug 1493
u1:add_order("BEWACHE")
u1:add_item("sword", 10)
u1:set_skill("melee", 2)
assert_equal(nil, u1.guard)
assert_equal(false, u1.guard)
u1:clear_orders()
u1:add_order("NACH O")
u1:add_order("ATTACKIERE " .. itoa36(u2.id))