* smallurl.el: Fixed a silly typo.
[ShellArchive.git] / xmlgen.etest
blob0ef576e94c34c5c8ba518475106f5d9b7550a225
1 (etest
2  ("xml-gen"
3   ("extract-plist"
4    (equal (xmlgen-extract-plist '(h1 :class "big" "A Title"))
5           '((h1 "A Title") (:class "big")))
6    (equal (xmlgen-extract-plist '(hello :big "world"))
7           '((hello) (:big "world")))
8    (equal (xmlgen-extract-plist '(big :one 1 :two 2 :three 3))
9           '((big) (:one 1 :two 2 :three 3))
10           "Slightly bigger plist")
11    (error (xmlgen-extract-plist '(hello "world" :how))
12           "Error thrown when plist is wrong size"))
13   ("xmlgen-attr-to-string"
14    (equal (xmlgen-attr-to-string '(:one "1" :two "2")) " one=\"1\" two=\"2\""))
15   ("xmlgen-string-escape"
16    (equal "This & this" (xmlgen-string-escape "This & this"))
17    (equal "This &lt;&amp;&gt; this" (xmlgen-string-escape "This <&> this")))
18   ("xmlgen"
19    (equal (xmlgen '(p :class "big")) "<p class=\"big\"/>")
20    (equal (xmlgen '(p :class "big" "hi")) "<p class=\"big\">hi</p>")
21    (equal (xmlgen '(h1)) "<h1/>")
22    (equal (xmlgen '(h1 "Title")) "<h1>Title</h1>")
23    (equal (xmlgen '(h1 :class "something" "hi"))
24         "<h1 class=\"something\">hi</h1>")
25    ("more complex"
26     (equal (xmlgen
27             '(html
28               (head
29                (title "hello")
30                (meta :something "hi"))))
31             (concat "<html><head><title>hello</title><meta something=\"hi\"/></head></html>"))))))