aboutsummaryrefslogtreecommitdiff
path: root/src/clojure/contrib/test_clojure
diff options
context:
space:
mode:
authorscgilardi <scgilardi@gmail.com>2009-02-10 04:53:11 +0000
committerscgilardi <scgilardi@gmail.com>2009-02-10 04:53:11 +0000
commit5ebc583193b7e8903a3e8349aacdf1626a6e7380 (patch)
tree2b6c6ee589f21fa43fc04473a6be7bd96b6b4a09 /src/clojure/contrib/test_clojure
parent31d234202eb3e838e683999e70adb8854d0d876b (diff)
fix issue 16: test-clojure/evaluation: from Shawn Hoover
Diffstat (limited to 'src/clojure/contrib/test_clojure')
-rw-r--r--src/clojure/contrib/test_clojure/evaluation.clj14
1 files changed, 11 insertions, 3 deletions
diff --git a/src/clojure/contrib/test_clojure/evaluation.clj b/src/clojure/contrib/test_clojure/evaluation.clj
index c8a5f0ba..fdd84bba 100644
--- a/src/clojure/contrib/test_clojure/evaluation.clj
+++ b/src/clojure/contrib/test_clojure/evaluation.clj
@@ -182,10 +182,18 @@
;;; Metadata tests ;;;
-; If a Symbol has metadata, it will not be part of the resulting value
+(defstruct struct-with-symbols (with-meta 'k {:a "A"}))
+
(deftest Metadata
- (is (not (nil? (meta (with-meta (symbol "test") {:doc "doc"})))))
- (is (nil? (meta (eval (with-meta (symbol "test") {:doc "doc"}))))))
+ (test-that
+ "If a Symbol has metadata, it will not be part of the resulting value"
+ (is (not (nil? (meta (with-meta (symbol "test") {:doc "doc"})))))
+ (is (nil? (meta (eval (with-meta (symbol "test") {:doc "doc"}))))))
+
+ (test-that
+ "find returns key symbols and their metadata"
+ (let [s (struct struct-with-symbols 1)]
+ (is (= {:a "A"} (meta (first (find s 'k))))))))
;;; Collections tests ;;;
(def x 1)