From a404ba169fa588d27dca44b07fb5734a47dd7e8b Mon Sep 17 00:00:00 2001 From: Matthew Butterick Date: Tue, 30 Sep 2014 11:27:50 -0700 Subject: [PATCH] ready to solve? --- csp/csp.rkt | 39 ++++++++++++++++++++++++++++++++++----- 1 file changed, 34 insertions(+), 5 deletions(-) diff --git a/csp/csp.rkt b/csp/csp.rkt index 9178af97..f101ebb6 100644 --- a/csp/csp.rkt +++ b/csp/csp.rkt @@ -6,6 +6,8 @@ (require racket/list racket/bool racket/contract racket/class racket/match racket/generator racket/string) (require "utils.rkt" "search.rkt") +(module+ test (require rackunit)) + (define CSP (class Problem #| This class describes finite-domain Constraint Satisfaction Problems. @@ -280,7 +282,7 @@ Set up to do recursive backtracking search. Allow the following options: nh) (module+ test - (parse_neighbors "X: Y Z; Y: Z")) + (check-equal? (sort (hash->list (parse_neighbors "X: Y Z; Y: Z")) string