From e370356fac692d3e19b31bb35bbe1d309bae9b61 Mon Sep 17 00:00:00 2001 From: Sergiu Ivanov Date: Thu, 23 Jul 2020 00:20:00 +0200 Subject: [PATCH] networks: Add some tests for tbf/state. --- networks.rkt | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/networks.rkt b/networks.rkt index 8139303..4080eab 100644 --- a/networks.rkt +++ b/networks.rkt @@ -955,5 +955,12 @@ ;;; weights, as well as a threshold. (define (make-tbf/state pairs threshold) (tbf/state (make-immutable-hash pairs) threshold)) + +(module+ test + (test-case "tbf/state" + (define f (make-tbf/state '((x1 . 1) (x2 . 1)) 1)) + (check-equal? (tbf/state-w f) #hash((x1 . 1) (x2 . 1))) + (check-equal? (tbf/state-θ f) 1))) + ;;; A TBN is a network form mapping TBFs to variables. (define tbn? (hash/c variable? tbf?))