diff options
author | Hugo Hörnquist <hugo@lysator.liu.se> | 2019-03-18 23:18:12 +0100 |
---|---|---|
committer | Hugo Hörnquist <hugo@lysator.liu.se> | 2019-03-18 23:18:12 +0100 |
commit | f509c70b6064c631c0de1c26ca4272d143188383 (patch) | |
tree | bac224d98f006faba5feb7149193b485fc06ea67 /tests/test.scm | |
parent | Simplified (monad state) modify. (diff) | |
download | scheme-monad-f509c70b6064c631c0de1c26ca4272d143188383.tar.gz scheme-monad-f509c70b6064c631c0de1c26ca4272d143188383.tar.xz |
Rewrote writer monad.
Diffstat (limited to '')
-rwxr-xr-x | tests/test.scm | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/tests/test.scm b/tests/test.scm index 6ce798e..562c736 100755 --- a/tests/test.scm +++ b/tests/test.scm @@ -51,3 +51,29 @@ (test-end "state-test") + +(test-begin "writer-test") + +(use-modules (monad writer)) + +(test-equal '(10 "HelloWorld") + (run-writer + (do (w "Hello") + (w "World") + (return-writer 10)))) + +(test-equal '(10 "HelloWorld") + (run-writer + (do "Hello" "World" + (return-writer 10)))) + +(test-equal '(3 "Applied + to (1 2) ⇒ 3\n") + (run-writer (with-writer + 1 2))) + +(test-equal '(10 "Hello, World") + (run-writer + (do (string-append "Hello" ", ") + "World" + (return-writer 10)))) + +(test-end "writer-test") |