This commit is contained in:
2025-06-08 20:04:42 +02:00
parent 175371ee00
commit e555df0ca2
5 changed files with 132 additions and 4 deletions

View File

@ -84,4 +84,16 @@ def test_placed_words_tracking():
assert placed.word == word
assert placed.row == 1
assert placed.col == 1
assert placed.orientation == Orientation.VERTICAL
assert placed.orientation == Orientation.VERTICAL
def test_valid_hello_world_crossword():
cw = make_crossword()
assert cw.add_word(DummyWord("HELLO"), 1, 0, Orientation.HORIZONTAL)
assert cw.add_word(DummyWord("WORLD"), 0, 4, Orientation.VERTICAL)
assert str(cw).count('H') == 1
assert str(cw).count('E') == 1
assert str(cw).count('L') == 3
assert str(cw).count('O') == 1
assert str(cw).count('W') == 1
assert str(cw).count('R') == 1
assert str(cw).count('D') == 1