From 234dbc781c328db11c3cc17a74d2c9301e5d82bf Mon Sep 17 00:00:00 2001 From: Leah Neukirchen Date: Fri, 16 Dec 2022 00:15:35 +0100 Subject: add inject-accumulator --- tests/test.mew | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'tests') 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)) -- cgit 1.4.1