Skip to content

Commit 910b3b6

Browse files
Relax naked triple test expectation
1 parent 3c01a4d commit 910b3b6

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

tests/test_strategies_core.py

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -157,12 +157,22 @@ def test_naked_triple_clears_unit() -> None:
157157
_set_candidates(cand, 2, 2, {2, 3})
158158
_set_candidates(cand, 2, 3, {1, 4})
159159

160+
before = {pos: cand[pos[0]][pos[1]].copy() for pos in ((2, 0), (2, 1), (2, 2), (2, 3))}
161+
160162
move = apply_naked_triple(grid, cand)
161163

162164
assert move is not None
163165
assert move["strategy"] == "naked_triple"
164-
assert move["r"] == 2 and move["c"] == 3
165-
assert 1 not in cand[2][3] and 2 not in cand[2][3] and 3 not in cand[2][3]
166+
assert move["unit"] == "row"
167+
assert move["unit_index"] == 2
168+
target = (move["r"], move["c"])
169+
removed = move["v"]
170+
171+
assert target[0] == 2
172+
assert target in before
173+
assert removed in {1, 2, 3}
174+
assert removed in before[target]
175+
assert cand[target[0]][target[1]] == before[target] - {removed}
166176

167177

168178
def test_hidden_triple_culls_extras() -> None:

0 commit comments

Comments
 (0)