2014-07-10 01:19:14 +00:00
|
|
|
(defmodule unit-calrissian-identity-monad-tests
|
2014-08-22 02:40:41 +00:00
|
|
|
(behaviour ltest-unit)
|
2014-04-25 05:27:47 +00:00
|
|
|
(export all)
|
|
|
|
(import
|
2014-08-22 02:40:41 +00:00
|
|
|
(from ltest
|
2014-04-25 05:27:47 +00:00
|
|
|
(check-failed-assert 2)
|
|
|
|
(check-wrong-assert-exception 2))))
|
|
|
|
|
2014-08-22 02:40:41 +00:00
|
|
|
(include-lib "deps/ltest/include/ltest-macros.lfe")
|
2014-04-25 05:27:47 +00:00
|
|
|
(include-lib "include/monads.lfe")
|
|
|
|
(include-lib "include/monad-tests.lfe")
|
|
|
|
|
2014-07-10 02:28:06 +00:00
|
|
|
(test-monad (monad 'identity))
|
2014-04-25 05:27:47 +00:00
|
|
|
|
|
|
|
(deftest identity
|
|
|
|
(is-equal 'ok
|
2014-07-10 02:28:06 +00:00
|
|
|
(return (monad 'identity) 'ok)))
|
2014-04-25 05:27:47 +00:00
|
|
|
|
|
|
|
(deftest fail-with-error
|
|
|
|
(is-throw #(error value)
|
2014-07-10 02:28:06 +00:00
|
|
|
(fail (monad 'identity) 'value)))
|