From 2f9325073b00930671572afcd159b75d6cfcd125 Mon Sep 17 00:00:00 2001 From: Enno Rehling Date: Mon, 5 Nov 2018 20:30:33 +0100 Subject: [PATCH] test for cart building --- scripts/tests/common.lua | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/scripts/tests/common.lua b/scripts/tests/common.lua index d1c34dfa7..2aec0fc0f 100644 --- a/scripts/tests/common.lua +++ b/scripts/tests/common.lua @@ -1171,3 +1171,14 @@ function test_faction_keys() assert_equal(1, f:get_key('more')) end +function test_cartmaking() + local f = faction.create('human') + local r = region.create(0, 0, 'plain') + local u = unit.create(f, r) + u:set_skill('cartmaking', 1) + u:add_item('log', 10) + u:add_order('MACHE Wagen') + process_orders() + assert_equal(1, u:get_item('cart')) + assert_equal(5, u:get_item('log')) +end