From 63905bb0a9c91e6ff61bcc5896246ec9a8d632bc Mon Sep 17 00:00:00 2001
From: Nathan Gass
Date: Wed, 8 Aug 2012 16:45:23 +0000
Subject: some more special char tests (normal utf8 chars, \xc2 at end, null
 bytes)

---
 tests/it_html.t | 21 +++++++++++++++++++++
 1 file changed, 21 insertions(+)

diff --git a/tests/it_html.t b/tests/it_html.t
index 2838ae1..2ed151c 100755
--- a/tests/it_html.t
+++ b/tests/it_html.t
@@ -1,6 +1,8 @@
 #!/www/server/bin/php -qC
 <?php
 
+it::getopt(""); #handle possible --debug parameter
+
 #  Tests for html.class
 
 # Traditional html generation
@@ -55,6 +57,25 @@ is(
 	"blank unprintable characters and illegal utf8 in attributes but not in normal text"
 );
 
+is(
+	div('arg' => "abc äüö éá© œàè îôÇ xyz", "abc äüö éá© œàè îôÇ xyz"),
+	"<div arg=\"abc äüö éá© œàè îôÇ xyz\">abc äüö éá© œàè îôÇ xyz</div>\n",
+	"leave legal utf8 intact",
+);
+
+unset($GLOBALS['debug_utf8check']);
+is(
+	div('arg' => "value \xc2", "content"),
+	"<div arg=\"value \xc2\">content</div>\n",
+	"handle single \\xc2 at end of attribute value",
+);
+
+is(
+	div("arg\x00end" => "value \x00 end", "content \x00 content end"),
+	"<div arg\x00end=\"value   end\">content \x00 content end</div>\n",
+	"handle 0-bytes",
+);
+
 is(
 	div('arg' => "& \" < > \n '", "& \" < > \n '"),
 	"<div arg=\"&amp; &quot; &lt; &gt; &#10; '\">& \" < > \n '</div>\n",
-- 
cgit v1.2.3