diff options
Diffstat (limited to 'src/clojure/contrib/test_clojure')
-rw-r--r-- | src/clojure/contrib/test_clojure/evaluation.clj | 14 |
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) |