def test1(): g = Graph(((0, ), )) assert g.rows == 1 assert g.cols == 1 assert g.count_islands() == 0 g = Graph(((1, ), )) assert g.rows == 1 assert g.cols == 1 assert g.count_islands() == 1
def test5(): g = Graph(((1, 1, 0, 0, 0), (0, 1, 0, 0, 1), (1, 0, 0, 1, 1), (0, 0, 0, 0, 0), (1, 0, 1, 0, 1))) assert g.rows == 5 assert g.cols == 5 assert g.count_islands() == 5
def test0(): g = Graph(((0, 0, 0, 0, 0), (0, 0, 0, 0, 0), (0, 0, 0, 0, 0), (0, 0, 0, 0, 0), (0, 0, 0, 0, 0))) assert g.rows == 5 assert g.cols == 5 assert g.count_islands() == 0
def test1c(): g = Graph(((1, 1, 1, 1, 1), (1, 1, 1, 1, 1), (1, 1, 1, 1, 1), (1, 1, 1, 1, 1), (1, 1, 1, 1, 1))) assert g.rows == 5 assert g.cols == 5 assert g.count_islands() == 1