Test legal movement of dolphins.

There were some unsubstantiated reports of dolphins possibly being able to walk on land, but tests do not confirm this.
This commit is contained in:
Enno Rehling 2015-04-09 01:41:16 +02:00
parent fb6ada9b57
commit b1c27ac210
2 changed files with 47 additions and 1 deletions

View File

@ -1,4 +1,4 @@
-- new tests 2015-02-13
require 'tests.e2.shiplanding'
require 'tests.e2.e2features'
require 'tests.e2.movement'

View File

@ -0,0 +1,46 @@
require "lunit"
module("tests.e2.movement", package.seeall, lunit.testcase)
function setup()
eressea.free_game()
eressea.settings.set("nmr.removenewbie", "0")
eressea.settings.set("nmr.timeout", "0")
eressea.settings.set("NewbieImmunity", "0")
end
function test_dolphin_on_land()
local r1 = region.create(0, 0, "plain")
local r2 = region.create(1, 0, "plain")
local f = faction.create("noreply@eressea.de", "human", "de")
local u1 = unit.create(f, r1, 1)
u1.race = "dolphin"
u1:clear_orders()
u1:add_order("NACH O")
process_orders()
assert_equal(r1, u1.region)
end
function test_dolphin_to_land()
local r1 = region.create(0, 0, "ocean")
local r2 = region.create(1, 0, "plain")
local f = faction.create("noreply@eressea.de", "human", "de")
local u1 = unit.create(f, r1, 1)
u1.race = "dolphin"
u1:clear_orders()
u1:add_order("NACH O")
process_orders()
assert_equal(r2, u1.region)
end
function test_dolphin_in_ocean()
local r1 = region.create(0, 0, "ocean")
local r2 = region.create(1, 0, "ocean")
local f = faction.create("noreply@eressea.de", "human", "de")
local u1 = unit.create(f, r1, 1)
u1.race = "dolphin"
u1:clear_orders()
u1:add_order("NACH O")
process_orders()
assert_equal(r2, u1.region)
end