summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorPeter Bex <peter@more-magic.net>2025-08-15 11:27:11 +0200
committerPeter Bex <peter@more-magic.net>2025-08-18 13:39:32 +0200
commitd3a425a4930fa4395246179ad0af504c783922fd (patch)
tree0d4a06282c7a6d819ad8b5d94e84290dbb028804 /tests
parentfa8d354bc49b0adc77e6dd6d973c8bd2d33f2769 (diff)
downloadslset-d3a425a4930fa4395246179ad0af504c783922fd.tar.gz
Add slset-delete and slset-contains?
Not strictly needed, but could be helpful and completes the operations. Also, if we ever reimplement it using some other strategy, this might be more useful.
Diffstat (limited to 'tests')
-rw-r--r--tests/run.scm21
1 files changed, 21 insertions, 0 deletions
diff --git a/tests/run.scm b/tests/run.scm
index e2bf76b..4d15ea7 100644
--- a/tests/run.scm
+++ b/tests/run.scm
@@ -56,6 +56,27 @@
(test-group "all symbols used here still clean"
(test-assert (clean? '(a b c d e i o u x)))))
+ (test-group "slset-delete"
+ (test-group "some examples"
+ (test '(a c d a c e)
+ (slset-delete '(a b c d a c e) 'b))
+ (test '(b c d c)
+ (slset-delete '(a b c d a c e) 'a 'e 'i))
+ (test '(b c d c e)
+ (slset-delete '(a b c d a c e) 'a 'a 'a))
+ (test '(a b c d a c e)
+ (slset-delete '(a b c d a c e) 'i)))
+ (test-group "all symbols used here still clean"
+ (test-assert (clean? '(a b c d e i)))))
+
+ (test-group "slset-contains?"
+ (test-group "some examples"
+ (test #t (slset-contains? '(a b c d a c e) 'a))
+ (test #t (slset-contains? '(a b c d a c e) 'a))
+ (test #f (slset-contains? '(a b c d a c e) 'i)))
+ (test-group "all symbols used here still clean"
+ (test-assert (clean? '(a b c d e i)))))
+
(test-group "slset-union"
(test-group "examples from srfi-1 document"
(test '(u o i a b c d e) (slset-union '(a b c d e) '(a e i o u)))