Release commit for 1.000006
[scpubgit/HTML-String.git] / t / simple.t
index af9ff91..cb788ab 100644 (file)
@@ -25,7 +25,7 @@ $three .= html('</tag>');
 is("$three", '<tag>Hi &lt;bob&gt;</tag>');
 
 my $four; {
-  use HTML::String::Overload { ignore => { lies => 1 } };
+  use HTML::String::Overload { ignore => { non_existant_package_name => 1 } };
 
   #$four = "<tag>".$hi."</tag>\n";
   $four = "<tag>$hi</tag>"."\n";
@@ -35,4 +35,32 @@ chomp($four);
 
 is("$four", '<tag>Hi &lt;bob&gt;</tag>');
 
+{
+    package MyPkg;
+
+    sub new { 'foo' }
+
+    sub load { 'bar' }
+}
+
+is(html('MyPkg')->new, 'foo');
+
+is(html('MyPkg')->load, 'bar');
+
+# Test that all characters that should be escaped are escaped
+
+my $raw_characters = q{<>&"'};
+my $expected_output = q{<tag>&lt;&gt;&amp;&quot;&#39;</tag>};
+my $html = html('<tag>').$raw_characters.html('</tag>');
+is($html, $expected_output);
+
+ok(HTML::String::Value->isa('HTML::String::Value'), 'isa on class ok');
+
+is($@, '', '$@ not set by check');
+
+is do {
+    use HTML::String::Overload;
+    '' . '0'
+}, '0', 'concatenating strings which are false in boolean context';
+
 done_testing;