diff --git a/networks-tests.rkt b/networks-tests.rkt index 1a82d91..b52b5fd 100644 --- a/networks-tests.rkt +++ b/networks-tests.rkt @@ -229,17 +229,17 @@ (check-false (f1/list '(#f))) (check-false (f1/list '(#t))))) (test-case "Random Boolean functions and networks" - (random-seed 0) - (check-equal? (random-boolean-table 2) '((#f #f #t) (#f #t #t) (#t #f #f) (#t #t #f))) - (let ([f (random-boolean-function 2)]) - (check-true (f #f #f)) (check-false (f #f #t)) (check-true (f #t #f)) (check-false (f #t #t))) - (let ([f (random-boolean-function/list 2)]) - (check-false (f '(#f #f))) (check-true (f '(#f #t))) - (check-true (f '(#t #f))) (check-false (f '(#t #t)))) - (begin - (random-seed 0) - (define f (random-boolean-function/state '(x1 x2))) - (check-equal? (tabulate-state/boolean f '(x1 x2)) - '((x1 x2 f) (#f #f #f) (#t #f #f) (#f #t #t) (#t #t #t))) - (check-equal? (tabulate-state/boolean f '(x1 x2) #:headers #f) - '((#f #f #f) (#t #f #f) (#f #t #t) (#t #t #t))))) + (random-seed 0) + (check-equal? (random-boolean-table 2) '((#f #f #t) (#f #t #t) (#t #f #f) (#t #t #f))) + (let ([f (random-boolean-function 2)]) + (check-true (f #f #f)) (check-false (f #f #t)) (check-true (f #t #f)) (check-false (f #t #t))) + (let ([f (random-boolean-function/list 2)]) + (check-false (f '(#f #f))) (check-true (f '(#f #t))) + (check-true (f '(#t #f))) (check-false (f '(#t #t)))) + (begin + (random-seed 0) + (define f (random-boolean-function/state '(x1 x2))) + (check-equal? (tabulate-state/boolean f '(x1 x2)) + '((x1 x2 f) (#f #f #f) (#t #f #f) (#f #t #t) (#t #t #t))) + (check-equal? (tabulate-state/boolean f '(x1 x2) #:headers #f) + '((#f #f #f) (#t #f #f) (#f #t #t) (#t #t #t)))))