Skip to content

Commit

Permalink
Add tests for a few more basic features
Browse files Browse the repository at this point in the history
  • Loading branch information
amalloy committed Jul 3, 2011
1 parent 252925e commit 5ff6a80
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions modules/prxml/src/test/clojure/clojure/contrib/test_prxml.clj
Expand Up @@ -2,9 +2,19 @@
(:use clojure.test clojure.contrib.prxml))

(deftest prxml-basic
(is (= "<p>Hello, World!</p>"
(with-out-str (prxml [:p "Hello, World!"])))))
(is (= "<p id=\"test\">Hello, World!</p>"
(with-out-str (prxml [:p {:id "test"} "Hello, World!"])))))

(deftest prxml-escaping
(is (= "<a href=\"foo&amp;bar\">foo&lt;bar</a>"
(with-out-str (prxml [:a {:href "foo&bar"} "foo<bar"])))))

(deftest prxml-pprint
(is (= "
<ol>
<li>1
</li>
</ol>"
(binding [*prxml-indent* 4]
(with-out-str
(prxml [:ol [:li 1]]))))))

0 comments on commit 5ff6a80

Please sign in to comment.