From 120a8c0173b2947ac9131abcd395a89db1267de5 Mon Sep 17 00:00:00 2001 From: Pasi Kallinen Date: Sat, 24 Jul 2021 20:29:15 +0300 Subject: [PATCH] Add shop creation test script --- test/test_shk.lua | 50 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) create mode 100644 test/test_shk.lua diff --git a/test/test_shk.lua b/test/test_shk.lua new file mode 100644 index 0000000000..4a324f3783 --- /dev/null +++ b/test/test_shk.lua @@ -0,0 +1,50 @@ + +-- Test shop creation + +function shk_test1(doors) +des.map([[ +--------- +|...|...| +|...+...| +|...|+--| +|----...| +|...|+--| +|...+...| +|...|...| +--------- +]]); + +des.teleport_region({ region = { 5,1, 7,7 }, dir = "both" }); +des.stair("down", 6, 2); +des.stair("up", 6, 6); + +des.door("open", 5, 3); +des.door("open", 5, 5); + +if (doors == 1) then + des.door("open", 4, 2); + des.door("closed", 4, 6); +end + +des.region({ region = { 1,1, 1,1 }, type = "shop", irregular=1, filled=1, lit=1 }); +des.region({ region = { 1,5, 1,5 }, type = "shop", irregular=1, filled=1, lit=1 }); + +if (doors == 2) then + des.door("open", 4, 2); + des.door("closed", 4, 6); +end + +end -- shk_test1 + + +function do_test(testfunc, param) + des.reset_level(); + des.level_init({ style = "solidfill", fg = " " }); + testfunc(param); + des.finalize_level(); +end + +do_test(shk_test1, 0); +do_test(shk_test1, 1); +do_test(shk_test1, 2); +