MCPcopy Index your code
hub / github.com/TheAlgorithms/Python / test

Function test

data_structures/arrays/sudoku_solver.py:44–61  ·  view source on GitHub ↗

A set of unit tests.

()

Source from the content-addressed store, hash-verified

42
43
44def test():
45 """A set of unit tests."""
46 assert len(squares) == 81
47 assert len(unitlist) == 27
48 assert all(len(units[s]) == 3 for s in squares)
49 assert all(len(peers[s]) == 20 for s in squares)
50 assert units["C2"] == [
51 ["A2", "B2", "C2", "D2", "E2", "F2", "G2", "H2", "I2"],
52 ["C1", "C2", "C3", "C4", "C5", "C6", "C7", "C8", "C9"],
53 ["A1", "A2", "A3", "B1", "B2", "B3", "C1", "C2", "C3"],
54 ]
55 # fmt: off
56 assert peers["C2"] == {
57 "A2", "B2", "D2", "E2", "F2", "G2", "H2", "I2", "C1", "C3",
58 "C4", "C5", "C6", "C7", "C8", "C9", "A1", "A3", "B1", "B3"
59 }
60 # fmt: on
61 print("All tests pass.")
62
63
64def parse_grid(grid):

Callers 1

sudoku_solver.pyFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected