bn-tests: Restructure.

Also make the names of test cases correspond to the names of the
sections in bn.
This commit is contained in:
Sergiu Ivanov 2020-02-18 12:20:32 +01:00
parent f0a7c270e9
commit 58e40e44ad

View file

@ -7,8 +7,7 @@
;;; This test case sets up the following Boolean network:
;;; x1 = x1 AND NOT x2
;;; x2 = NOT x2
(test-begin
(test-case "Simple two-variable Boolean network"
(test-case "Basic definitions"
(let* ([f1 (λ ([s : State])
(let ([x1 (hash-ref s 'x1)]
[x2 (hash-ref s 'x2)])
@ -30,9 +29,9 @@
[new-s (update bn s '(x2 x1))])
(check-equal? (hash-ref new-s 'x1) #f)
(check-equal? (hash-ref new-s 'x2) #t)
(check-equal? (length (hash-keys new-s)) 2)))
(check-equal? (length (hash-keys new-s)) 2)))))
(test-case "Constructing networks from forms"
(test-case "Syntactic description of Boolean networks"
(let ([s (make-state '((x . #t) (y . #f)))]
[f (update-func-form->update-func '(and x y))])
(check-equal? (f s) #f))
@ -41,4 +40,4 @@
(b . (not b))))]
[s (make-state '((a . #t) (b . #t)))])
(check-equal? ((hash-ref bn1 'a) s) #t)
(check-equal? ((hash-ref bn2 'a) s) #t))))))
(check-equal? ((hash-ref bn2 'a) s) #t)))