Permalink
Browse files

Add tests for a few more basic features

  • Loading branch information...
1 parent 252925e commit 5ff6a80cc577558dda51cdbe4b4ec75534913627 @amalloy committed Jul 3, 2011
Showing with 12 additions and 2 deletions.
  1. +12 −2 modules/prxml/src/test/clojure/clojure/contrib/test_prxml.clj
View
14 modules/prxml/src/test/clojure/clojure/contrib/test_prxml.clj
@@ -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.