~sschwarzer/sudoku-solver

fe3dde2e18a0e7a8823b817c6d819d495a94098f — Sorawee Porncharoenwase 5 months ago 9ce754e
Fix check-true and check-false

check-true and check-false consume only one argument.
If there are multiple things to test, they must be in separate expressions.
1 files changed, 12 insertions(+), 12 deletions(-)

M games/sudoku-solver/solver.rkt
M games/sudoku-solver/solver.rkt => games/sudoku-solver/solver.rkt +12 -12
@@ 522,29 522,29 @@
        "`row-valid?` and `index-valid?`"
        (define test-board (list->board test-board-data))
        ; Indices 12 and 16 are in the second row (1-based).
        (check-true (row-valid? test-board 12)
                    (index-valid? test-board 12))
        (check-true (row-valid? test-board 12))
        (check-true (index-valid? test-board 12))
        (define new-board (board-set test-board 16 9))
        (check-false (row-valid? new-board 12)
                     (index-valid? new-board 12)))
        (check-false (row-valid? new-board 12))
        (check-false (index-valid? new-board 12)))
      (test-case
        "`column-valid?` and `index-valid?`"
        (define test-board (list->board test-board-data))
        ; Indices 12 and 30 are in the fourth column (1-based).
        (check-true (column-valid? test-board 12)
                    (index-valid? test-board 12))
        (check-true (column-valid? test-board 12))
        (check-true (index-valid? test-board 12))
        (define new-board (board-set test-board 30 4))
        (check-false (column-valid? new-board 12)
                     (index-valid? new-board 12)))
        (check-false (column-valid? new-board 12))
        (check-false (index-valid? new-board 12)))
      (test-case
        "`region-valid?` and `index-valid?`"
        (define test-board (list->board test-board-data))
        ; Indices 12 and 23 are in the same region.
        (check-true (region-valid? test-board 12)
                    (index-valid? test-board 12))
        (check-true (region-valid? test-board 12))
        (check-true (index-valid? test-board 12))
        (define new-board (board-set test-board 23 7))
        (check-false (region-valid? new-board 12)
                     (index-valid? new-board 12)))
        (check-false (region-valid? new-board 12))
        (check-false (index-valid? new-board 12)))
      (test-case
        "Invalid board"
        (define test-board (list->board test-board-data))