-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Switches from fiasco to fiveam test framework
- Loading branch information
1 parent
7072d93
commit 62c4339
Showing
6 changed files
with
24 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
*~ | ||
*~ | ||
*.fasl |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,4 +3,5 @@ | |
(:export #:tmap | ||
#:tfilter | ||
#:flip | ||
#:combine)) | ||
#:combine | ||
#:transducer)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,22 @@ | ||
(fiasco:define-test-package #:cl-transducer-test | ||
(:use #:cl-transducer)) | ||
(defpackage #:cl-transducer-tests | ||
(:use #:5AM #:cl #:cl-transducer)) | ||
|
||
(in-package #:cl-transducer-test) | ||
(in-package #:cl-transducer-tests) | ||
|
||
(deftest test-reduce-to-a-single-output () | ||
(def-suite* transducer-suite :description "cl-transducer test suite.") | ||
|
||
(test reduce-to-a-single-output () | ||
(let ((input '(1 2 3 4)) | ||
(reducer (combine #'+ (tmap 1+) (tfilter evenp)))) | ||
(is (equal 8 (reduce reducer input :initial-value 0))))) | ||
|
||
(deftest test-reduce-to-list () | ||
(test reduce-to-list () | ||
(is (equal '(2 4) (reverse (reduce (combine (flip cons) | ||
(tmap incf) | ||
(tfilter oddp)) | ||
'(1 2 3 4) | ||
:initial-value nil))))) | ||
|
||
(test transducer-macro () | ||
(let ((transd (transducer 0 #'+ (tmap 1+) (tfilter evenp)))) | ||
(is (equal 8 (funcall transd '(1 2 3 4)))))) |