From: Pasi Kallinen Date: Wed, 4 Mar 2020 20:07:10 +0000 (+0200) Subject: Lua tests for map and room contents X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=54ca0c2211b41c80017c031009b55d4551d4d90c;p=nethack Lua tests for map and room contents --- diff --git a/test/test_des.lua b/test/test_des.lua index 2a0062ac5..5159c5e0a 100644 --- a/test/test_des.lua +++ b/test/test_des.lua @@ -214,6 +214,15 @@ FFF]] }) III .I. III]] }) + des.map({ coord = {30, 5}, map = [[ +... +... +...]], contents = function(map) + des.terrain(0,0, "L"); + des.terrain(map.width-1,map.height-1, "T"); + end}); + check_loc_name(30, 5, "lava pool"); + check_loc_name(32, 7, "tree"); end function test_feature() @@ -317,9 +326,11 @@ function test_room() }); des.room({ type="ordinary", coord={3, 3}, w=3, h=3 }); des.room(); - des.room({ contents = function() + des.room({ contents = function(rm) des.object(); des.monster(); + des.terrain(0,0, "L"); + des.terrain(rm.width, rm.height, "T"); end }); des.random_corridors();