diff --git a/res/config-e3a.xml b/res/config-e3a.xml
index a42b5ffdb..f4b0a7401 100644
--- a/res/config-e3a.xml
+++ b/res/config-e3a.xml
@@ -64,7 +64,6 @@
-
diff --git a/scripts/e3a/modules.lua b/scripts/e3a/modules.lua
index 59a3aef7f..60045005a 100644
--- a/scripts/e3a/modules.lua
+++ b/scripts/e3a/modules.lua
@@ -9,4 +9,5 @@ tests = {
srcpath .. '/eressea/scripts/tests/morale.lua',
srcpath .. '/shared/scripts/tests/common.lua',
srcpath .. '/eressea/scripts/tests/e3a.lua',
+ srcpath .. '/eressea/scripts/tests/stealth.lua',
}
diff --git a/scripts/tests/e3a.lua b/scripts/tests/e3a.lua
index 1d5e446c6..a3b15f62f 100644
--- a/scripts/tests/e3a.lua
+++ b/scripts/tests/e3a.lua
@@ -48,6 +48,19 @@ function test_attrib()
end
end
+function test_no_stealth()
+ local r = region.create(0,0, "plain")
+ local f = faction.create("noreply@eressea.de", "human", "de")
+ local u = unit.create(f, r, 1)
+
+ u:set_skill("stealth", 1)
+ assert_equal(-1, u:get_skill("stealth"))
+ u:clear_orders()
+ u:add_order("LERNEN TARNUNG")
+ process_orders()
+ assert_equal(-1, u:get_skill("stealth"))
+end
+
function test_seecast()
local r = region.create(0,0, "plain")
for i = 1,10 do
diff --git a/scripts/tests/stealth.lua b/scripts/tests/stealth.lua
new file mode 100644
index 000000000..c1ff9dcb2
--- /dev/null
+++ b/scripts/tests/stealth.lua
@@ -0,0 +1,42 @@
+require "lunit"
+
+module("e3-stealth", package.seeall, lunit.testcase)
+
+function setup_stealth()
+ local result = {}
+ free_game()
+ result.r = region.create(0,0, "plain")
+ result.f1 = faction.create("noreply@eressea.de", "human", "de")
+ result.f2 = faction.create("noreply@eressea.de", "human", "de")
+ result.u1 = unit.create(result.f1, result.r, 1)
+ result.u2 = unit.create(result.f2, result.r, 1)
+ result.u1:add_item("money", 1000)
+ result.u2:add_item("money", 1000)
+ return result
+end
+
+function test_stealth_faction_on()
+ local result = setup_stealth()
+ local f = result.f2
+ local u = result.u1
+ u:clear_orders()
+ u:add_order("TARNEN PARTEI")
+
+ 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))
+end
+
+function test_stealth_faction_off()
+ local result = setup_stealth()
+ local f = result.f2
+ local u = result.u1
+ u:clear_orders()
+ u:add_order("TARNEN PARTEI")
+
+ 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))
+end