annotate src/clojure/contrib/test_contrib/test_repl_utils.clj @ 10:ef7dbbd6452c

added clojure source goodness
author Robert McIntyre <rlm@mit.edu>
date Sat, 21 Aug 2010 06:25:44 -0400
parents
children
rev   line source
rlm@10 1 (ns clojure.contrib.test-repl-utils
rlm@10 2 (:use clojure.test
rlm@10 3 clojure.contrib.repl-utils))
rlm@10 4
rlm@10 5 (deftest test-apropos
rlm@10 6 (testing "with a regular expression"
rlm@10 7 (is (= '[defmacro] (apropos #"^defmacro$")))
rlm@10 8 (is (some '#{defmacro} (apropos #"def.acr.")))
rlm@10 9 (is (= [] (apropos #"nothing-has-this-name"))))
rlm@10 10
rlm@10 11
rlm@10 12 (testing "with a string"
rlm@10 13 (is (some '#{defmacro} (apropos "defmacro")))
rlm@10 14 (is (some '#{defmacro} (apropos "efmac")))
rlm@10 15 (is (= [] (apropos "nothing-has-this-name"))))
rlm@10 16
rlm@10 17 (testing "with a symbol"
rlm@10 18 (is (some '#{defmacro} (apropos 'defmacro)))
rlm@10 19 (is (some '#{defmacro} (apropos 'efmac)))
rlm@10 20 (is (= [] (apropos 'nothing-has-this-name)))))