summary refs log tree commit diff
path: root/tests
diff options
context:
space:
mode:
authorLeah Neukirchen <leah@vuxu.org>2022-12-16 00:15:35 +0100
committerLeah Neukirchen <leah@vuxu.org>2022-12-16 00:15:48 +0100
commit234dbc781c328db11c3cc17a74d2c9301e5d82bf (patch)
tree3d786a0b3289154ba2e7a012250deb66a513d3e1 /tests
parenta68ffccdccc9023c1beb14cae2a8d2695e517da0 (diff)
downloadmew-234dbc781c328db11c3cc17a74d2c9301e5d82bf.tar.gz
mew-234dbc781c328db11c3cc17a74d2c9301e5d82bf.tar.xz
mew-234dbc781c328db11c3cc17a74d2c9301e5d82bf.zip
add inject-accumulator
Diffstat (limited to 'tests')
-rw-r--r--tests/test.mew7
1 files changed, 7 insertions, 0 deletions
diff --git a/tests/test.mew b/tests/test.mew
index cbcf2ff..d72b881 100644
--- a/tests/test.mew
+++ b/tests/test.mew
@@ -501,6 +501,13 @@
   (test #t (void? (into (nth-accumulator 8) '(4 5 6 7))))
   (test #t (void? (into (nth-accumulator 8) '()))))
 
+(test-group "inject-accumulator"
+  (test 10 (into (inject-accumulator +) (generator 1 2 3 4)))
+  (test 0 (into (inject-accumulator +) (generator)))
+  (test 20 (into (inject-accumulator + 10) (generator 1 2 3 4)))
+  (test 10 (into (inject-accumulator + 10) (generator)))
+  (test '((1 . 2) . 3) (into (inject-accumulator cons) (generator 1 2 3))))
+
 (test-group "one-of"
   (test #t ((one-of 1 2 3) 1))
   (test #f ((one-of 1 2 3) 4))