diff 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
line wrap: on
line diff
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/src/clojure/contrib/test_contrib/test_repl_utils.clj	Sat Aug 21 06:25:44 2010 -0400
     1.3 @@ -0,0 +1,20 @@
     1.4 +(ns clojure.contrib.test-repl-utils
     1.5 +  (:use clojure.test
     1.6 +	clojure.contrib.repl-utils))
     1.7 +
     1.8 +(deftest test-apropos
     1.9 +  (testing "with a regular expression"
    1.10 +    (is (= '[defmacro] (apropos #"^defmacro$")))
    1.11 +    (is (some '#{defmacro} (apropos #"def.acr.")))
    1.12 +    (is (= [] (apropos #"nothing-has-this-name"))))
    1.13 +  
    1.14 +
    1.15 +  (testing "with a string"
    1.16 +    (is (some '#{defmacro} (apropos "defmacro")))
    1.17 +    (is (some '#{defmacro} (apropos "efmac")))
    1.18 +    (is (= [] (apropos "nothing-has-this-name"))))
    1.19 +
    1.20 +  (testing "with a symbol"
    1.21 +    (is (some '#{defmacro} (apropos 'defmacro)))
    1.22 +    (is (some '#{defmacro} (apropos 'efmac)))
    1.23 +    (is (= [] (apropos 'nothing-has-this-name)))))