From 250faefff4820984ac7977ea25f1bb58b2c10d97 Mon Sep 17 00:00:00 2001 From: Enno Rehling Date: Wed, 27 Dec 2017 07:11:21 +0100 Subject: [PATCH] fix potion test, use only one --- scripts/tests/e2/items.lua | 1 - scripts/tests/e3/items.lua | 13 +++++++++---- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/scripts/tests/e2/items.lua b/scripts/tests/e2/items.lua index 4af2d80c2..c2f479460 100644 --- a/scripts/tests/e2/items.lua +++ b/scripts/tests/e2/items.lua @@ -23,7 +23,6 @@ function test_water_of_life() process_orders() assert_equal(0, u:get_item('p2')) assert_equal(0, u:get_item('log')) - process_orders() assert_equal(trees+10, r:get_resource('sapling')) end diff --git a/scripts/tests/e3/items.lua b/scripts/tests/e3/items.lua index 5886ab85c..1df6be85a 100644 --- a/scripts/tests/e3/items.lua +++ b/scripts/tests/e3/items.lua @@ -14,15 +14,20 @@ function test_water_of_life() local f = faction.create("human") local u = unit.create(f, r, 1) local trees = r:get_resource('tree') - u:add_item('p2', 2) + u:add_item('p2', 1) u:add_item('log', 10) u:add_order("BENUTZE 1 'Wasser des Lebens'") u:add_order("ZEIGE 'Wasser des Lebens'") process_orders() - assert_equal(1, u:get_item('p2')) + assert_equal(0, u:get_item('p2')) assert_equal(5, u:get_item('log')) - process_orders() - assert_equal(trees+5, r:get_resource('tree')) + trees = r:get_resource('tree')-trees + if trees~=5 then + init_reports() + write_report(f) + print(f, get_turn()) + end + assert_equal(5, trees) end function test_give_horses()