Commits

Meikel Brandmeyer committed a7851df

Re-designed interface to follow clojure.contrib.test-is

* infrastructure.clj (test-driver): adapted docstring to new interface

* tests.clj (is): new macro
(is*): new multimethod. All tests rewrote to as methods for is*

All tests adapted to new interface.

  • Participants
  • Parent commits 269cb89

Comments (0)

Files changed (14)

src/de/kotka/tap/infrastructure.clj

 
 (defn test-driver
   "Driver function for the tests. This function should only be called, when
-  defining new test macros. The driver receives the actual form under test
+  defining new test methods. The driver receives the actual form under test
   as a closure as well as it's quoted form. Similarly the expected value is
   transferred. The following description is optional and might be „nil“.
   Finally two callbacks to compare the actual result against the expected
 
   Example:
 
-  | => (defmacro in-intervall?
-  |      [min max body & desc]
-  |      `(let [min# ~min
-  |             max# ~max]
-  |         (test-driver (fn [] ~body)
-  |                      '~body
-  |                      (fn [] nil)   ; Don't need „expected result“.
-  |                      ~(first desc) ; Might be „nil“.
-  |                      (fn [expected# actual#]
-  |                        (<= min# actual# max#))
-  |                      (fn [expected# actual# result#]
-  |                        (diag (str „Expected:      “ actual#))
-  |                        (diag (str „to be between: “ min#))
-  |                        (diag (str „and:           “ max#))
-  |                        (diag (str „but was:       “ result#))))))
+  | => (defmethod is* 'in-intervall?
+  |      [t desc]
+  |      (let [[min max body] (rest t)]
+  |        `(let [min# ~min
+  |               max# ~max]
+  |           (test-driver (fn [] ~body)
+  |                        (quote ~body)
+  |                        (fn [] nil)   ; Don't need „expected result“.
+  |                        ~desc         ; Might be „nil“.
+  |                        (fn [expected# actual#]
+  |                          (<= min# actual# max#))
+  |                        (fn [expected# actual# result#]
+  |                          (diag (str „Expected:      “ actual#))
+  |                          (diag (str „to be between: “ min#))
+  |                          (diag (str „and:           “ max#))
+  |                          (diag (str „but was:       “ result#)))))))
   |
-  | => (in-intervall? 100 150 (flogiston-pressure) „flogiston pressure ok“)
+  | => (is (in-intervall? 100 150 (flogiston-pressure)) „flogiston pressure ok“)
   | not ok 1 - flogiston pressure ok
   | # Expected:      (flogiston-pressure)
   | # to be between: 100

src/de/kotka/tap/tests.clj

 
 (clojure/in-ns 'de.kotka.tap)
 
-(defmacro ok?
-  "Simple yes/no test. <ok?> simply tests whether the given test evaluates to
-  true. In this nature it cannot give much of diagnostic information, but it
-  is sufficient for simple predicate tests.
+(defn- test-tag [t] (if (seq? t) (first t) t))
+(defn- actual   [t] (second t))
+(defn- expected [t] (second (rest t)))
 
-  Example:
+(defmulti
+  #^{:doc
+  "is* is the driver for the is macro and should not be called directly."}
+  is*
+  (fn [x & _] (test-tag x)))
 
-  | => (ok? (pressure-save? (flogiston-pressure)) „flogiston pressure is save“)
-  | not ok 1 - flogiston pressure is save
-  | # Expected: (pressure-save? (flogiston-pressure)) to be true"
-  [t & desc]
+(defmethod is* :default
+  [t desc]
   `(test-driver (fn [] ~t)
                 (quote ~t)
                 (fn [] nil)
-                ~(first desc)
+                ~desc
                 (fn [e# a#] a#)
                 (fn [e# a# r#]
                   (diag (.. "Expected: "
                             (concat a#)
                             (concat " to be true"))))))
 
-(defmacro is?
-  "Comparison with „=“. <is?> does evaluate the given expected value and the
-  actual value. It compares both using „=“. If this fails, <is?> presents the
-  user some more diagnostics about why the test failed.
-
-  Example:
-
-  | => (is? (flogiston-pressure) *normal-flogiston-pressure*
-  |      „flogiston pressure is normal“)
-  | not ok 1 - „flogiston pressure is normal“
-  | # Expected: (flogiston-pressure)
-  | # to be:    125
-  | # but was:  58"
-  [actual exp & desc]
-  `(test-driver (fn [] ~actual)
-                (quote ~actual)
-                (fn [] ~exp)
-                ~(first desc)
+(defmethod is* '=
+  [t desc]
+  `(test-driver (fn [] ~(actual t))
+                (quote ~(actual t))
+                (fn [] ~(expected t))
+                ~desc
                 (fn [e# a#] (= e# a#))
                 (fn [e# a# r#]
                   (diag (.concat "Expected: " a#))
                   (diag (.concat "to be:    " e#))
                   (diag (.concat "but was:  " r#)))))
 
-(defmacro isnt?
-  "Compare using „not=“. <isnt?> is similar to <is?>, but actually succeeds
-  when the actual is not equal to the expected value."
-  [actual exp & desc]
-  `(test-driver (fn [] ~actual)
-                (quote ~actual)
-                (fn [] ~exp)
-                ~(first desc)
+(defmethod is* 'not=
+  [t desc]
+  `(test-driver (fn [] ~(actual t))
+                (quote ~(actual t))
+                (fn [] ~(expected t))
+                ~desc
                 (fn [e# a#] (not= e# a#))
                 (fn [e# a# r#]
                   (diag (.concat "Expected:  " a#))
                   (diag (.concat "not to be: " e#)))))
 
-(defmacro like?
-  "String checking with regular expressions. <like?> checks whether the given
-  string matches the supplied regular expression."
-  [actual exp & desc]
-  `(test-driver (fn [] ~actual)
-                (quote ~actual)
-                (fn [] ~exp)
-                ~(first desc)
+(defmethod is* 'like?
+  [t desc]
+  `(test-driver (fn [] ~(actual t))
+                (quote ~(actual t))
+                (fn [] ~(expected t))
+                ~desc
                 (fn [e# a#] (not (nil? (re-find e# a#))))
                 (fn [e# a# r#]
                   (diag (.concat "Expected: " a#))
                   (diag (.concat "to match: " e#)))))
 
-(defmacro unlike?
-  "String checking with regular expressions. <unlike?> checks whether the given
-  string does *not* match the supplied regular expression."
-  [actual exp & desc]
-  `(test-driver (fn [] ~actual)
-                (quote ~actual)
-                (fn [] ~exp)
-                ~(first desc)
+(defmethod is* 'unlike?
+  [t desc]
+  `(test-driver (fn [] ~(actual t))
+                (quote ~(actual t))
+                (fn [] ~(expected t))
+                ~desc
                 (fn [e# a#] (nil? (re-find e# a#)))
                 (fn [e# a# r#]
                   (diag (.concat "Expected:     " a#))
                   (diag (.concat "not to match: " e#))
                   (diag (.concat "string was:   " r#)))))
 
-(defmacro throws?
-  "Check whether given the Exception is thrown. In case the supplied body runs
-  through without throwing an exception or if an Exception different from the
-  named is thrown, the test fails."
-  [exn body & desc]
+(defmethod is* 'throwing?
+  [t desc]
   `(test-driver (fn []
                   (try
                     (do
-                      ~body
+                      ~(second (rest t))
                       false)
-                    (catch ~exn e#
+                    (catch ~(second t) e#
                       true)))
-                (quote ~body)
-                (fn [] ~exn)
-                ~(first desc)
+                (quote ~(second (rest t)))
+                (fn [] ~(second t))
+                ~desc
                 (fn [e# a#] a#)
                 (fn [e# a# r#]
                   (diag (.concat "Expected: " a#))
                   (diag (.concat "to throw: " e#)))))
 
-(defmacro runs?
-  "The code does not throw an Exception. This is not really a test at all.
-  <runs?> just runs the supplied body and succeeds if body runs through
-  without throwing an Exception. It returns whatever the body returns.
-
-  Example:
-
-  | => (def flogiston-reactor (runs? (new FlogistonReactor)
-  |                             „created new flogiston reactor“))
-  | ok 1 - created new flogiston reactor"
-  [body & desc]
-  `(test-driver (fn [] ~body)
-                (quote ~body)
+(defmethod is* 'running?
+  [t desc]
+  `(test-driver (fn [] ~(second t))
+                (quote ~(second t))
                 (fn [] nil)
-                ~(first desc)
+                ~desc
                 (fn [e# a#] true)
                 (fn [e# a# r#]
                   (diag (.concat "Expected " a#
                                  " to run through w/o exception.")))))
+
+(defmacro is
+  "is* runs the given comparison and reports any error or Exception. Based on
+  the predicate used further diagnostic information is provided. See below
+  for a list of supported predicates and corresponding examples.
+
+  Supported Predicates:
+
+    :default  - a simply yes/no test executing the provided form, which
+                should evaluate to false in case the test fails
+    =         - compare the actual vs. the expected value using =.
+    not=      - same but with not=
+    like?     - use re-find to check whether the given string matches
+                the given regular expression
+    unlike?   - use re-find to check whether the given string does
+                not match the given regular expression
+    throwing? - check whether the form throws the given Exception
+    running?  - check whether the form runs w/o throwing an Exception
+
+  Examples:
+
+  | => (is (pressure-save? (flogiston-pressure)) „flogiston pressure is save“)
+  | not ok 1 - flogiston pressure is save
+  | # Expected: (pressure-save? (flogiston-pressure)) to be true
+
+  | => (is (= (flogiston-pressure) *normal-flogiston-pressure*)
+  |      „flogiston pressure is normal“)
+  | not ok 2 - „flogiston pressure is normal“
+  | # Expected: (flogiston-pressure)
+  | # to be:    125
+  | # but was:  58
+
+  | => (def flogiston-reactor (is (running? (new FlogistonReactor))
+  |                               „created new flogiston reactor“))
+  | ok 3 - created new flogiston reactor"
+  [t & desc]
+  (is* t (first desc)))
 
 echo 1..5
 
-try "(ok? true)" "ok 1" "true w/o description"
-try "(ok? false)" "not ok 1
+try "(is true)" "ok 1" "true w/o description"
+try "(is false)" "not ok 1
 # Expected: false to be true" "false w/o description"
-try "(ok? true \"success\")" "ok 1 - success" "true w/ description"
-try "(ok? false \"failure\")" "not ok 1 - failure
+try "(is true \"success\")" "ok 1 - success" "true w/ description"
+try "(is false \"failure\")" "not ok 1 - failure
 # Expected: false to be true" "false w/ description"
 
-try '(ok? (throw (new Exception "exception")) "exception")' \
+try '(is (throw (new Exception "exception")) "exception")' \
 'not ok 1 - exception
 # Exception was thrown: java.lang.Exception: exception' "exceptions are caught"
 
 
 echo 1..4
 
-try "(is? (- 1 1) 0)" "ok 1" "true w/o description"
-try "(is? (+ 1 1) 0)" "not ok 1
+try "(is (= (- 1 1) 0))" "ok 1" "true w/o description"
+try "(is (= (+ 1 1) 0))" "not ok 1
 # Expected: (+ 1 1)
 # to be:    0
 # but was:  2" "false w/o description"
-try "(is? (- 1 1) 0 \"success\")" "ok 1 - success" "true w/ description"
-try "(is? (+ 1 1) 0 \"failure\")" "not ok 1 - failure
+try "(is (= (- 1 1) 0) \"success\")" "ok 1 - success" "true w/ description"
+try "(is (= (+ 1 1) 0) \"failure\")" "not ok 1 - failure
 # Expected: (+ 1 1)
 # to be:    0
 # but was:  2" "false w/ description"
 
 echo 1..4
 
-try "(isnt? (- 1 1) 2)" "ok 1" "true w/o description"
-try "(isnt? (+ 1 1) 2)" "not ok 1
+try "(is (not= (- 1 1) 2))" "ok 1" "true w/o description"
+try "(is (not= (+ 1 1) 2))" "not ok 1
 # Expected:  (+ 1 1)
 # not to be: 2" "false w/o description"
-try "(isnt? (- 1 1) 2 \"success\")" "ok 1 - success" "true w/ description"
-try "(isnt? (+ 1 1) 2 \"failure\")" "not ok 1 - failure
+try "(is (not= (- 1 1) 2) \"success\")" "ok 1 - success" "true w/ description"
+try "(is (not= (+ 1 1) 2) \"failure\")" "not ok 1 - failure
 # Expected:  (+ 1 1)
 # not to be: 2" "false w/ description"
 
 
 echo 1..4
 
-try '(like? (.concat "foo" "bar") #"o+b")' "ok 1" "true w/o description"
-try '(like? (.concat "foo" "bar") #"xx")' 'not ok 1
+try '(is (like? (.concat "foo" "bar") #"o+b"))' "ok 1" "true w/o description"
+try '(is (like? (.concat "foo" "bar") #"xx"))' 'not ok 1
 # Expected: (.concat "foo" "bar")
 # to match: #"xx"' "false w/o description"
-try '(like? (.concat "foo" "bar") #"o+b" "success")' "ok 1 - success" \
+try '(is (like? (.concat "foo" "bar") #"o+b") "success")' "ok 1 - success" \
 	"true w/ description"
-try '(like? (.concat "foo" "bar") #"xx" "failure")' 'not ok 1 - failure
+try '(is (like? (.concat "foo" "bar") #"xx") "failure")' 'not ok 1 - failure
 # Expected: (.concat "foo" "bar")
 # to match: #"xx"' "false w/ description"
 
 
 echo 1..4
 
-try '(unlike? (.concat "foo" "bar") #"xx")' "ok 1" "true w/o description"
-try '(unlike? (.concat "foo" "bar") #"o+b")' 'not ok 1
+try '(is (unlike? (.concat "foo" "bar") #"xx"))' "ok 1" "true w/o description"
+try '(is (unlike? (.concat "foo" "bar") #"o+b"))' 'not ok 1
 # Expected:     (.concat "foo" "bar")
 # not to match: #"o+b"
 # string was:   "foobar"' "false w/o description"
-try '(unlike? (.concat "foo" "bar") #"xx" "success")' "ok 1 - success" \
+try '(is (unlike? (.concat "foo" "bar") #"xx") "success")' "ok 1 - success" \
     "true w/ description"
-try '(unlike? (.concat "foo" "bar") #"o+b" "failure")' 'not ok 1 - failure
+try '(is (unlike? (.concat "foo" "bar") #"o+b") "failure")' 'not ok 1 - failure
 # Expected:     (.concat "foo" "bar")
 # not to match: #"o+b"
 # string was:   "foobar"' "false w/ description"
 
 echo 1..4
 
-try '(todo (ok? true ))' "ok 1 # TODO" \
+try '(todo (is true))' "ok 1 # TODO" \
 	"true TODO w/o description"
-try '(todo (ok? false))' 'not ok 1 # TODO
+try '(todo (is false))' 'not ok 1 # TODO
 # Expected: false to be true' "false TODO w/o description"
-try '(todo (ok? true "success"))' "ok 1 # TODO - success" \
+try '(todo (is true "success"))' "ok 1 # TODO - success" \
     "true TODO w/ description"
-try '(todo (ok? false "failure"))' 'not ok 1 # TODO - failure
+try '(todo (is false "failure"))' 'not ok 1 # TODO - failure
 # Expected: false to be true' "false TODO w/ description"
 
 cleanup
 
 echo 1..6
 
-try '(skip "for test" (ok? (do (println "FAILED") true)))' \
+try '(skip "for test" (is (do (println "FAILED") true)))' \
 	"ok 1 # SKIP - for test" "true SKIP w/o description"
-try '(skip "for test" (ok? (do (println "FAILED") false)))' \
+try '(skip "for test" (is (do (println "FAILED") false)))' \
 	'ok 1 # SKIP - for test' "false SKIP w/o description"
-try '(skip "for test" (ok? (do (println "FAILED") true) "success"))' \
+try '(skip "for test" (is (do (println "FAILED") true) "success"))' \
 	"ok 1 # SKIP - for test" "true SKIP w/ description"
-try '(skip "for test" (ok? (do (println "FAILED") false) "failure"))' \
+try '(skip "for test" (is (do (println "FAILED") false) "failure"))' \
 	'ok 1 # SKIP - for test' "false SKIP w/ description"
 
-try '(skip-if true "for test" (ok? (do (println "FAILED") false) "failure"))' \
+try '(skip-if true "for test" (is (do (println "FAILED") false) "failure"))' \
 	'ok 1 # SKIP - for test' "true skip-if w/ description"
-try '(skip-if false "for test" (ok? (do (println "OK") true) "success"))' \
+try '(skip-if false "for test" (is (do (println "OK") true) "success"))' \
 	'OK
 ok 1 - success' "false skip-if w/ description"
 
+#! /bin/sh
+#-
+# Copyright 2008 (c) Meikel Brandmeyer.
+# All rights reserved.
+#
+# Permission is hereby granted, free of charge, to any person obtaining a copy
+# of this software and associated documentation files (the "Software"), to deal
+# in the Software without restriction, including without limitation the rights
+# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+# copies of the Software, and to permit persons to whom the Software is
+# furnished to do so, subject to the following conditions:
+#
+# The above copyright notice and this permission notice shall be included in
+# all copies or substantial portions of the Software.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+# THE SOFTWARE.
+
+. t/testlib.sh
+
+echo 1..4
+
+try '(is (throwing? Exception (throw (new Exception "x"))))' \
+	"ok 1" "success w/o message"
+try '(is (throwing? Exception (throw (new Exception "x"))) "success")' \
+	"ok 1 - success" "success w/ message"
+
+try '(is (throwing? Exception true))' 'not ok 1
+# Expected: true
+# to throw: #=java.lang.Exception' "failure w/o message"
+try '(is (throwing? Exception true) "failure")' 'not ok 1 - failure
+# Expected: true
+# to throw: #=java.lang.Exception' "failure w/ message"
+
+cleanup
+
+# vim:ft=sh:

t/010_throws.t

-#! /bin/sh
-#-
-# Copyright 2008 (c) Meikel Brandmeyer.
-# All rights reserved.
-#
-# Permission is hereby granted, free of charge, to any person obtaining a copy
-# of this software and associated documentation files (the "Software"), to deal
-# in the Software without restriction, including without limitation the rights
-# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-# copies of the Software, and to permit persons to whom the Software is
-# furnished to do so, subject to the following conditions:
-#
-# The above copyright notice and this permission notice shall be included in
-# all copies or substantial portions of the Software.
-#
-# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-# THE SOFTWARE.
-
-. t/testlib.sh
-
-echo 1..4
-
-try '(throws? Exception (throw (new Exception "x")))' \
-	"ok 1" "success w/o message"
-try '(throws? Exception (throw (new Exception "x")) "success")' \
-	"ok 1 - success" "success w/ message"
-
-try '(throws? Exception true)' 'not ok 1
-# Expected: true
-# to throw: #=java.lang.Exception' "failure w/o message"
-try '(throws? Exception true "failure")' 'not ok 1 - failure
-# Expected: true
-# to throw: #=java.lang.Exception' "failure w/ message"
-
-cleanup
-
-# vim:ft=sh:
+#! /bin/sh
+#-
+# Copyright 2008 (c) Meikel Brandmeyer.
+# All rights reserved.
+#
+# Permission is hereby granted, free of charge, to any person obtaining a copy
+# of this software and associated documentation files (the "Software"), to deal
+# in the Software without restriction, including without limitation the rights
+# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+# copies of the Software, and to permit persons to whom the Software is
+# furnished to do so, subject to the following conditions:
+#
+# The above copyright notice and this permission notice shall be included in
+# all copies or substantial portions of the Software.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+# THE SOFTWARE.
+
+. t/testlib.sh
+
+echo 1..4
+
+try '(is (= (is (running? 1)) 1))' 'ok 1
+ok 2' 'success w/o message'
+try '(is (= (is (running? 1) "success") 1))' 'ok 1 - success
+ok 2' 'success w/ message'
+
+try '(is (= (is (running? (do (throw (new Exception "x")) "reached")))
+            (symbol "de.kotka.tap" "test-failed")))' 'not ok 1
+# Exception was thrown: java.lang.Exception: x
+ok 2' 'failure w/o message'
+try '(is (= (is (running? (do (throw (new Exception "x")) "reached")) "failure")
+            (symbol "de.kotka.tap" "test-failed")))' \
+'not ok 1 - failure
+# Exception was thrown: java.lang.Exception: x
+ok 2' 'failure w/ message'
+
+cleanup
+
+# vim:ft=sh:

t/011_runs.t

-#! /bin/sh
-#-
-# Copyright 2008 (c) Meikel Brandmeyer.
-# All rights reserved.
-#
-# Permission is hereby granted, free of charge, to any person obtaining a copy
-# of this software and associated documentation files (the "Software"), to deal
-# in the Software without restriction, including without limitation the rights
-# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-# copies of the Software, and to permit persons to whom the Software is
-# furnished to do so, subject to the following conditions:
-#
-# The above copyright notice and this permission notice shall be included in
-# all copies or substantial portions of the Software.
-#
-# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-# THE SOFTWARE.
-
-. t/testlib.sh
-
-echo 1..4
-
-try '(is? 1 (runs? 1))' 'ok 1
-ok 2' 'success w/o message'
-try '(is? 1 (runs? 1 "success"))' 'ok 1 - success
-ok 2' 'success w/ message'
-
-try '(is? (symbol "de.kotka.tap" "test-failed") (runs? (do (throw (new Exception "x")) "reached")))' \
-'not ok 1
-# Exception was thrown: java.lang.Exception: x
-ok 2' 'failure w/o message'
-try '(is? (symbol "de.kotka.tap" "test-failed") (runs? (do (throw (new Exception "x")) "reached") "failure"))' \
-'not ok 1 - failure
-# Exception was thrown: java.lang.Exception: x
-ok 2' 'failure w/ message'
-
-cleanup
-
-# vim:ft=sh:
 
 echo 1..2
 
-try '(fatal (ok? true) (ok? true))' 'ok 1
+try '(fatal (is true) (is true))' 'ok 1
 ok 2' "fatal runs through on success"
-try '(fatal (ok? false) (ok? true))' 'not ok 1
+try '(fatal (is false) (is true))' 'not ok 1
 # Expected: false to be true' "fatal stops on failure"
 
 cleanup