From 0683a2016670be8fba1d0a017f1a4a393f918083 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dominik=20Pant=C5=AF=C4=8Dek?= Date: Thu, 6 Jul 2023 22:02:59 +0200 Subject: [PATCH] Test count and contains. --- src/util-bst.scm | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/src/util-bst.scm b/src/util-bst.scm index 03b5cfc..8abb088 100644 --- a/src/util-bst.scm +++ b/src/util-bst.scm @@ -189,6 +189,23 @@ ((bst? 'fixnum) "string")) (test-true bst-empty? (bst-empty? (make-bst 'fixnum eq? <))) + (test-true bst-contains? + (bst-contains? + (bst-set + (make-bst 'fixnum eq? <) + 1 2) 1)) + (test-false bst-contains? + (bst-contains? (make-bst 'fixnum eq? <) 1)) + (test-equal? bst-count + (bst-count + (make-bst 'fixnum eq? <)) + 0) + (test-equal? bst-count + (bst-count + (bst-set + (make-bst 'fixnum eq? <) + 1 2)) + 1) )) )