;;;; amb-test.scm -*- Scheme -*- ;;;; Kon Lovett, Jul '18 (import test) (test-begin "Amb") ;;; (import scheme) (import (chicken base)) (import amb amb-extras) (test-group "basic example" (test '(1 2 3 4) (all-of (amb 1 2 3 4))) ) (test-group "kalotan example" (include-relative "../amb-examples/amb-kalotan") (test "kalotan" '(female male female) (solve-kalotan-puzzle)) ) (test-group "money example" (include-relative "../amb-examples/amb-money") (test "amb-money" '(9 5 6 7 + 1 0 8 5 = 1 0 6 5 2) (caddr (solve-money-puzzle))) ) (test-group "dwelling example" (include-relative "../amb-examples/amb-dwelling") (test '((baker 3) (cooper 2) (fletcher 4) (miller 5) (smith 1)) (solve-dwelling-puzzle)) ) (test-group "sat-solv example" (include-relative "../amb-examples/amb-sat-solve") (test '(#f #f #t) (sat-solve)) ) (test-group "pythagorean example" (include-relative "../amb-examples/amb-pythagorean") (test '(4 3 5) (pythagorean)) ) ;;; (test-end "Amb") (test-exit)