]> granicus.if.org Git - nethack/commitdiff
Lua tests for map and room contents
authorPasi Kallinen <paxed@alt.org>
Wed, 4 Mar 2020 20:07:10 +0000 (22:07 +0200)
committerPasi Kallinen <paxed@alt.org>
Wed, 4 Mar 2020 20:07:10 +0000 (22:07 +0200)
test/test_des.lua

index 2a0062ac51656902b1edd08e38db1833ca76128f..5159c5e0a22925b15fd758df74b287c8b47674c9 100644 (file)
@@ -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();