diff --git a/csp/test-classes.rkt b/csp/test-classes.rkt index a0bc28f5..21e129e4 100644 --- a/csp/test-classes.rkt +++ b/csp/test-classes.rkt @@ -46,11 +46,13 @@ (send problem reset) (send problem add-variables '(a b) '(1 2)) (send problem add-constraint <) ; implicit -(check-hash-items (send problem get-solution) #hash((a . 1) (b . 2))) +(check-true (let ([s (sort (hash->list (send problem get-solution)) #:key cdr <)]) + (or (equal? s '((a . 1) (b . 2))) (equal? s '((b . 1) (a . 2)))))) (send problem reset) (send problem add-variables '(a b) '(1 2)) (send problem add-constraint (new function-constraint% [func <])) ; explicit -(check-hash-items (send problem get-solution) #hash((a . 1) (b . 2))) +(check-true (let ([s (sort (hash->list (send problem get-solution)) #:key cdr <)]) + (or (equal? s '((a . 1) (b . 2))) (equal? s '((b . 1) (a . 2)))))) ;; AllDifferentConstraint (send problem reset)