from roglick.dungeon.base import Map,Tile
from roglick.dungeon import tiles


def test_flood_fill_returns_cells_once():
    m = Map(50,50)
    for x in range(1,50):
        for y in range(1,50):
            m.tiles[x][y] = Tile(**tiles.FloorTile)

    cells = [cell for cell in m.flood_fill(6,6)]

    while 0 < len(cells):
        cell = cells.pop()
        assert cell not in cells

def test_flood_fill_fills_area():
    m = Map(50,50)
    for x in range(50):
        for y in range(50):
            m.tiles[x][y] = Tile(**tiles.FloorTile)

    cells = [cell for cell in m.flood_fill(6,6)]

    assert 50*50 == len(cells)


@@ -69,16 +69,50 @@
 t tiles%0A
+from roglick.engine import random%0A
 %0A%0Adef te
@@ -156,32 +156,49 @@
    m = Map(50,50
+, random.Random()
 )%0A    for x in r
@@ -480,16 +480,33 @@
 ap(50,50
+, random.Random()
 )%0A    fo

Fix flood fill test