#lang racket

(require rackunit)
(require "../examples/sudoku.rkt")

(define (check-sudoku input output)
  (check-equal? (solve-sudoku/string input) output))

(define/provide-test-suite test-sudoku
  (check-sudoku
   "974236158638591742125487936316754289742918563589362417867125394253649871491873625"
   "974236158638591742125487936316754289742918563589362417867125394253649871491873625")
  (check-sudoku
   "2564891733746159829817234565932748617128_6549468591327635147298127958634849362715"
   "256489173374615982981723456593274861712836549468591327635147298127958634849362715")
  (check-sudoku
   "3_542_81_4879_15_6_29_5637485_793_416132_8957_74_6528_2413_9_655_867_192_965124_8"
   "365427819487931526129856374852793641613248957974165283241389765538674192796512438")
  (check-sudoku
   "__2_3___8_____8____31_2_____6__5_27__1_____5_2_4_6__31____8_6_5_______13__531_4__"
   "672435198549178362831629547368951274917243856254867931193784625486592713725316489")
  (check-sudoku
   "85___24__72______9__4_________1_7__23_5___9___4___________8__7__17__________36_4_"
   "859612437723854169164379528986147352375268914241593786432981675617425893598736241")
  The next problem is the hardest known Sudoku problem , the Platinum Blonde .
  z3.rkt solves this problem in a few hundred milliseconds
  (check-sudoku
   "_______12________3__23__4____18____5_6__7_8_______9_____85_____9___4_5__47___6___"
   "839465712146782953752391486391824675564173829287659341628537194913248567475916238")
  (check-sudoku
   (make-string 81 #\_) ; Empty grid: has multiple solutions
   #f))

 Empty grid: has multiple solutions
#lang racket

(require rackunit)
(require "../examples/sudoku.rkt")

(define (check-sudoku input output)
  (check-equal? (solve-sudoku/string input) output))

(define/provide-test-suite test-sudoku
  (check-sudoku
   "974236158638591742125487936316754289742918563589362417867125394253649871491873625"
   "974236158638591742125487936316754289742918563589362417867125394253649871491873625")
  (check-sudoku
   "2564891733746159829817234565932748617128_6549468591327635147298127958634849362715"
   "256489173374615982981723456593274861712836549468591327635147298127958634849362715")
  (check-sudoku
   "3_542_81_4879_15_6_29_5637485_793_416132_8957_74_6528_2413_9_655_867_192_965124_8"
   "365427819487931526129856374852793641613248957974165283241389765538674192796512438")
  (check-sudoku
   "__2_3___8_____8____31_2_____6__5_27__1_____5_2_4_6__31____8_6_5_______13__531_4__"
   "672435198549178362831629547368951274917243856254867931193784625486592713725316489")
  (check-sudoku
   "85___24__72______9__4_________1_7__23_5___9___4___________8__7__17__________36_4_"
   "859612437723854169164379528986147352375268914241593786432981675617425893598736241")
  The next problem is the hardest known Sudoku problem , the Platinum Blonde .
  z3.rkt solves this problem in a few hundred milliseconds
  (check-sudoku
   "_______12________3__23__4____18____5_6__7_8_______9_____85_____9___4_5__47___6___"
   "839465712146782953752391486391824675564173829287659341628537194913248567475916238")
  (check-sudoku
   #f))
