Permalink
Browse files

Add a test for namespace-awareness as requested in #2.

This test fails, but I'm not sure if that's because the code is
wrong or because I don't totally understand XML namespaces - at
least it looks like the code is trying to be namespace-aware.
@chouser, can you take a look?
  • Loading branch information...
amalloy committed Nov 23, 2011
1 parent 240680e commit c0597366ad8a5a572e75fcc45211b932c83b8766
Showing with 11 additions and 0 deletions.
  1. +11 −0 modules/xml/src/test/clojure/clojure/data/xml/test_emit.clj
@@ -35,6 +35,17 @@
"</a>")]
(is (= expect (with-out-str (xml/emit deep-tree))))))
+(deftest namespaced
+ (is (= (str "<?xml version=\"1.0\" encoding=\"UTF-8\"?>"
+ "<body xmlns:api=\"http://some.uri.com/location\">"
+ "<api:method args=\"\" ret=\"int\" />"
+ "</body>")
+ (with-out-str
+ (xml/emit (element :body
+ {:xmlns/api "http://some.uri.com/location"}
+ (element :api/method
+ {:args "" :ret "int"})))))))
+
(deftest mixed-quotes
(is (= (str "<?xml version=\"1.0\" encoding=\"UTF-8\"?>"
"<mixed double=\"&quot;double&quot;quotes&quot;here&quot;\""

0 comments on commit c059736

Please sign in to comment.