summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorStuart Halloway <stu@thinkrelevance.com>2010-10-11 10:11:32 -0400
committerStuart Halloway <stu@thinkrelevance.com>2010-10-12 19:45:57 -0400
commit83fc4fe476b75553a4c2db8bd4f7fdfc02379dce (patch)
tree20b1ff6615edf2601f517efffec9f19d224ad487 /test
parentc50f2b86d91ad057bfc34c03c8ffd5d6634e6435 (diff)
fixes and tests for #276 find-keyword
Signed-off-by: Stuart Halloway <stu@thinkrelevance.com>
Diffstat (limited to 'test')
-rw-r--r--test/clojure/test_clojure.clj1
-rw-r--r--test/clojure/test_clojure/keywords.clj25
2 files changed, 26 insertions, 0 deletions
diff --git a/test/clojure/test_clojure.clj b/test/clojure/test_clojure.clj
index f2b71a3e..fa482d88 100644
--- a/test/clojure/test_clojure.clj
+++ b/test/clojure/test_clojure.clj
@@ -63,6 +63,7 @@
:java.shell
:transients
:def
+ :keywords
])
(def test-namespaces
diff --git a/test/clojure/test_clojure/keywords.clj b/test/clojure/test_clojure/keywords.clj
new file mode 100644
index 00000000..9ef86d7d
--- /dev/null
+++ b/test/clojure/test_clojure/keywords.clj
@@ -0,0 +1,25 @@
+; Copyright (c) Rich Hickey. All rights reserved.
+; The use and distribution terms for this software are covered by the
+; Eclipse Public License 1.0 (http://opensource.org/licenses/eclipse-1.0.php)
+; which can be found in the file epl-v10.html at the root of this distribution.
+; By using this software in any fashion, you are agreeing to be bound by
+; the terms of this license.
+; You must not remove this notice, or any other, from this software.
+
+(ns clojure.test-clojure.keywords
+ (:use clojure.test))
+
+(let [this-ns (str (.name *ns*))]
+ (deftest test-find-keyword
+ :foo
+ ::foo
+ (let [absent-keyword-sym (gensym "absent-keyword-sym")]
+ (are [result lookup] (= result (find-keyword lookup))
+ :foo :foo
+ :foo 'foo
+ :foo "foo"
+ nil absent-keyword-sym
+ nil (str absent-keyword-sym))
+ (are [result lookup] (= result (find-keyword this-ns lookup))
+ ::foo "foo"
+ nil (str absent-keyword-sym)))))