2014-07-09 21:19:14 -04:00
|
|
|
(defmodule unit-calrissian-identity-monad-tests
|
2015-05-21 17:31:11 -05:00
|
|
|
(behaviour ltest-unit)
|
|
|
|
(export all))
|
2014-04-25 01:27:47 -04:00
|
|
|
|
2015-05-21 17:31:11 -05:00
|
|
|
(include-lib "ltest/include/ltest-macros.lfe")
|
|
|
|
(include-lib "calrissian/include/monads.lfe")
|
|
|
|
(include-lib "calrissian/include/monad-tests.lfe")
|
2014-04-25 01:27:47 -04:00
|
|
|
|
2014-07-09 22:28:06 -04:00
|
|
|
(test-monad (monad 'identity))
|
2014-04-25 01:27:47 -04:00
|
|
|
|
|
|
|
(deftest identity
|
|
|
|
(is-equal 'ok
|
2014-07-09 22:28:06 -04:00
|
|
|
(return (monad 'identity) 'ok)))
|
2014-04-25 01:27:47 -04:00
|
|
|
|
|
|
|
(deftest fail-with-error
|
|
|
|
(is-throw #(error value)
|
2014-07-09 22:28:06 -04:00
|
|
|
(fail (monad 'identity) 'value)))
|