From c1ba286843e1ad36183cb6d19514c660e071116a Mon Sep 17 00:00:00 2001 From: Matthew Butterick Date: Fri, 25 May 2018 15:33:01 -0700 Subject: [PATCH] fix tests --- csp/test-classes.rkt | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) 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)