aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorMasaya Tojo <masaya@tojo.tokyo>2024-06-14 02:25:10 +0900
committerMasaya Tojo <masaya@tojo.tokyo>2024-06-14 02:25:10 +0900
commit326a2a122e76dd9252558551d3f5e61c4014c2c1 (patch)
treee15c4afe27f696fec5a548b6f230b38111bebf5c /tests
parent9fc5da3b546ec101357fb826d7282a73cd790e83 (diff)
Fix foldable interfaces
Diffstat (limited to 'tests')
-rw-r--r--tests/run.scm10
1 files changed, 4 insertions, 6 deletions
diff --git a/tests/run.scm b/tests/run.scm
index b49db8e..8d78396 100644
--- a/tests/run.scm
+++ b/tests/run.scm
@@ -71,19 +71,17 @@
(module (data list foldable) = (algebraic-structures foldable)
(import (chicken module))
- (reexport (only (chicken base) foldl foldr)))
+ (reexport (only (srfi 1) fold)))
(import (prefix (data list foldable) list:))
-(test '(a b c d e) (list:foldr cons '() '(a b c d e)))
-(test '(((((() a) b) c) d) e) (list:foldl list '() '(a b c d e)))
+(test '(e d c b a) (list:fold cons '() '(a b c d e)))
(test 0 (list:length '()))
(test 5 (list:length '(a b c d e)))
-(test #f (list:find (constantly #t) '()))
-(test #f (list:find even? '(1 3 5 7)))
-(test 4 (list:find even? '(1 3 4 7 8)))
+(test 0 (list:count even? '(1 3 5 7)))
+(test 2 (list:count even? '(1 3 4 7 8)))
(test #f (list:any (constantly #t) '()))
(test #f (list:any (cut member 'x <>) '((a b c) (d e f))))