Skip to content

Commit

Permalink
Test for html5 options evaluation
Browse files Browse the repository at this point in the history
  • Loading branch information
stain committed Sep 30, 2014
1 parent 31c06be commit 1a53d3a
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions test/hiccup/test/page.clj
Original file line number Diff line number Diff line change
Expand Up @@ -61,13 +61,21 @@
(str "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n"
"<!DOCTYPE html>\n"
"<html xml:og=\"http://ogp.me/ns#\" xmlns=\"http://www.w3.org/1999/xhtml\">"
"<body>Hello World</body></html>")))
"<body>Hello World</body></html>")))
(is (= (html5 {:xml? true, :lang "en"
"xml:og" "http://ogp.me/ns#"} [:body "Hello World"])
(str "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n"
"<!DOCTYPE html>\n"
"<html lang=\"en\" xml:lang=\"en\" xml:og=\"http://ogp.me/ns#\" xmlns=\"http://www.w3.org/1999/xhtml\">"
"<body>Hello World</body></html>")))))
"<body>Hello World</body></html>"))))
(testing "Evaluation of options"
(defn delayed-false [] false) ; should be evaluated by macro
(let [options {:xml? (delayed-false)}]
(is (= (html5 options [:head [:title "Hello"]])
(str "<!DOCTYPE html>\n<html>"
"<head><title>Hello</title></head></html>"))))))



(deftest include-js-test
(is (= (include-js "foo.js")
Expand Down

0 comments on commit 1a53d3a

Please sign in to comment.