Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
branch: master
Fetching contributors…

Cannot retrieve contributors at this time

37 lines (36 sloc) 1.708 kB
(etest
("xml-gen"
("extract-plist"
(equal (xmlgen-extract-plist '(h1 :class "big" "A Title"))
'((h1 "A Title") (:class "big")))
(equal (xmlgen-extract-plist '(hello :big "world"))
'((hello) (:big "world")))
(equal (xmlgen-extract-plist '(big :one 1 :two 2 :three 3))
'((big) (:one 1 :two 2 :three 3))
"Slightly bigger plist")
(error (xmlgen-extract-plist '(hello "world" :how))
"Error thrown when plist is wrong size"))
("xmlgen-attr-to-string"
(equal (xmlgen-attr-to-string '(:one "1" :two "2")) " one=\"1\" two=\"2\""))
("xmlgen-string-escape"
(equal "This & this" (xmlgen-string-escape "This & this"))
(equal "This &lt;&amp;&gt; this" (xmlgen-string-escape "This <&> this")))
("xmlgen"
(equal (xmlgen '(p "this & this")) "<p>this &amp; this</p>")
(equal (xmlgen '(p :class "big")) "<p class=\"big\"/>")
(equal (xmlgen '(p :class "big" "hi")) "<p class=\"big\">hi</p>")
(equal (xmlgen '(h1)) "<h1/>")
(equal (xmlgen '(h1 "Title")) "<h1>Title</h1>")
(equal (xmlgen '(h1 :class "something" "hi"))
"<h1 class=\"something\">hi</h1>")
(equal (xmlgen '(div (p "Escaped: &") (!unescape (p "Unescaped: &") (!escape
(p "& escaped")))))
"<div><p>Escaped: &amp;</p><p>Unescaped: &</p><p>&amp; escaped</p></div>")
(equal (xmlgen '(p "hello" "again")) "<p>helloagain</p>")
("more complex"
(equal (xmlgen
'(html
(head
(title "hello")
(meta :something "hi"))))
(concat "<html><head><title>hello</title><meta something=\"hi\"/></head></html>"))))))
Jump to Line
Something went wrong with that request. Please try again.