|
| 1 | +import pytest |
| 2 | + |
| 3 | +from permuta import Perm |
| 4 | +from tilescopethree.strategies import fusion_with_interleaving |
| 5 | +from tilings import Obstruction, Tiling |
| 6 | + |
| 7 | + |
| 8 | +@pytest.fixture |
| 9 | +def tiling1(): |
| 10 | + t = Tiling(obstructions=[ |
| 11 | + Obstruction(Perm((1, 0)), ((0, 1), (1, 1))), |
| 12 | + Obstruction(Perm((1, 0)), ((0, 1), (0, 1))), |
| 13 | + Obstruction(Perm((1, 0)), ((0, 1), (1, 0))), |
| 14 | + Obstruction(Perm((1, 0)), ((0, 1), (0, 0))), |
| 15 | + Obstruction(Perm((1, 0)), ((0, 0), (0, 0))), |
| 16 | + Obstruction(Perm((1, 0)), ((0, 0), (1, 0))), |
| 17 | + Obstruction(Perm((1, 0)), ((1, 0), (1, 0))), |
| 18 | + Obstruction(Perm((1, 0)), ((1, 1), (1, 0))), |
| 19 | + Obstruction(Perm((1, 0)), ((1, 1), (1, 1))) |
| 20 | + ]) |
| 21 | + return t |
| 22 | + |
| 23 | + |
| 24 | +@pytest.fixture |
| 25 | +def tiling2(): |
| 26 | + t = Tiling(obstructions=[ |
| 27 | + Obstruction(Perm((0, 1)), ((0, 0), (1, 0))), |
| 28 | + Obstruction(Perm((0, 2, 1)), ((0, 0), (0, 0), (0, 0))), |
| 29 | + Obstruction(Perm((0, 2, 1)), ((1, 0), (1, 0), (1, 0))), |
| 30 | + Obstruction(Perm((0, 2, 1, 3)), ((0, 0), (0, 0), (2, 0), (2, 0))), |
| 31 | + Obstruction(Perm((0, 2, 1, 3)), ((0, 0), (2, 0), (2, 0), (2, 0))), |
| 32 | + Obstruction(Perm((0, 2, 1, 3)), ((1, 0), (1, 0), (2, 0), (2, 0))), |
| 33 | + Obstruction(Perm((0, 2, 1, 3)), ((1, 0), (2, 0), (2, 0), (2, 0))), |
| 34 | + Obstruction(Perm((0, 2, 1, 3)), ((2, 0), (2, 0), (2, 0), (2, 0))) |
| 35 | + ]) |
| 36 | + return t |
| 37 | + |
| 38 | + |
| 39 | +def test_fusion_with_interleaving(tiling1, tiling2): |
| 40 | + assert len(list(fusion_with_interleaving(tiling1))) == 0 |
| 41 | + assert len(list(fusion_with_interleaving(tiling2))) == 1 |
0 commit comments