summaryrefslogtreecommitdiff
path: root/tests/it_html.t
diff options
context:
space:
mode:
authorChristian A. Weber2018-04-23 15:41:46 +0200
committerChristian A. Weber2018-04-23 15:41:46 +0200
commit930db3b36d87cd084e918f5cce6bc8f5760663ca (patch)
tree67b59d60a3beb00c02850d71b7c7fe39c57751da /tests/it_html.t
parent6ed5d50f5bd4ccc4d78dfdc47f3b95d4bdc20af3 (diff)
downloaditools-930db3b36d87cd084e918f5cce6bc8f5760663ca.tar.gz
itools-930db3b36d87cd084e918f5cce6bc8f5760663ca.tar.bz2
itools-930db3b36d87cd084e918f5cce6bc8f5760663ca.zip
officially support htmltype => 'xml', don't short-close voidtags in xhtml mode
Diffstat (limited to 'tests/it_html.t')
-rwxr-xr-xtests/it_html.t21
1 files changed, 19 insertions, 2 deletions
diff --git a/tests/it_html.t b/tests/it_html.t
index 0c419b8..bcfd40d 100755
--- a/tests/it_html.t
+++ b/tests/it_html.t
@@ -108,9 +108,26 @@ foreach (array('html5' => "<br flag>", 'html' => "<br flag>", 'xhtml' => "<br fl
is (trim(br(array('flag' => true))), $value, "Check empty tag and attribute for $type");
}
+# XHTML generation
+unset($GLOBALS['it_html']);
+new it_html(array('htmltype' => "xhtml", 'tags' => "script"));
+
+is(
+ script(),
+ "<script></script>\n",
+ "script may not be shortened (see xhtml spec)"
+);
+
+is(
+ h1(),
+ "<h1></h1>\n",
+ "empty h1 tag in xhtml context"
+);
+
+
# XML generation
unset($GLOBALS['it_html']);
-new it_html(array('htmltype' => "xhtml", 'tags' => "xmltest"));
+new it_html(array('htmltype' => "xml", 'tags' => "xmltest"));
is(
xmltest(),
@@ -121,7 +138,7 @@ is(
is(
xmltest("foo"),
"<xmltest>foo</xmltest>\n",
- "empty xmltest tag"
+ "non-empty xmltest tag"
);
is(