remove prefixes from E3

move prefix test to common.lua
This commit is contained in:
Enno Rehling 2015-09-12 13:37:43 +02:00
parent 1b44e73320
commit 3003b7fc61
5 changed files with 28 additions and 27 deletions

View File

@ -1,6 +1,7 @@
{ {
"include": [ "include": [
"keywords.json", "keywords.json",
"prefixes.json",
"e3/terrains.json" "e3/terrains.json"
], ],
"settings": { "settings": {

View File

@ -6,7 +6,6 @@
<xi:include href="config://core/common/items.xml"/> <xi:include href="config://core/common/items.xml"/>
<xi:include href="config://core/common/herbs.xml" /> <xi:include href="config://core/common/herbs.xml" />
<xi:include href="config://core/spoils.xml"/> <xi:include href="config://core/spoils.xml"/>
<xi:include href="config://core/prefixes.xml"/>
<xi:include href="config://core/common/buildings.xml"/> <xi:include href="config://core/common/buildings.xml"/>
<xi:include href="config://game/familiars.xml"/> <xi:include href="config://game/familiars.xml"/>

View File

@ -1085,3 +1085,29 @@ function test_parser()
os.remove(filename) os.remove(filename)
assert_equal("Goldene Herde", u.name) assert_equal("Goldene Herde", u.name)
end end
local function set_order(u, str)
u:clear_orders()
u:add_order(str)
end
function test_prefix()
local r0 = region.create(0, 0, "plain")
local f1 = faction.create("noreply@eressea.de", "human", "de")
local u1 = unit.create(f1, r0, 1)
set_order(u1, "PRAEFIX See")
process_orders()
assert_not_nil(u1:show():find("Seemensch"))
u1.race = "elf"
assert_not_nil(u1:show():find("Seeelf"))
set_order(u1, "PRAEFIX Mond")
process_orders()
assert_not_nil(u1:show():find("Mondelf"))
set_order(u1, "PRAEFIX")
process_orders()
assert_not_nil(u1:show():find("Elf"))
end

View File

@ -335,29 +335,3 @@ function test_stonegolems()
assert_equal(1 ,u2.number, "There shoud be one Stone Golems") assert_equal(1 ,u2.number, "There shoud be one Stone Golems")
-- end test Stone Golems four stones -- end test Stone Golems four stones
end end
local function set_order(u, str)
u:clear_orders()
u:add_order(str)
end
function test_prefix()
local r0 = region.create(0, 0, "plain")
local f1 = faction.create("noreply@eressea.de", "human", "de")
local u1 = unit.create(f1, r0, 1)
set_order(u1, "PRAEFIX See")
process_orders()
assert_not_nil(u1:show():find("Seemensch"))
u1.race = "elf"
assert_not_nil(u1:show():find("Seeelf"))
set_order(u1, "PRAEFIX Mond")
process_orders()
assert_not_nil(u1:show():find("Mondelf"))
set_order(u1, "PRAEFIX")
process_orders()
assert_not_nil(u1:show():find("Elf"))
end

1
tests/data/inactive Normal file
View File

@ -0,0 +1 @@
c93c:Menschen:1:4