summaryrefslogtreecommitdiff
path: root/test/erb/test_erb.rb
diff options
context:
space:
mode:
Diffstat (limited to 'test/erb/test_erb.rb')
-rw-r--r--test/erb/test_erb.rb10
1 files changed, 10 insertions, 0 deletions
diff --git a/test/erb/test_erb.rb b/test/erb/test_erb.rb
index 05d255623a..79c8d9c0e2 100644
--- a/test/erb/test_erb.rb
+++ b/test/erb/test_erb.rb
@@ -37,6 +37,16 @@ class TestERB < Test::Unit::TestCase
}
assert_match(/\Atest filename:1\b/, e.backtrace[0])
end
+
+ def test_html_escape
+ # TODO: &apos; should be chaged to &#x27;
+ assert_equal(" !&quot;\#$%&amp;&apos;()*+,-./0123456789:;&lt;=&gt;?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~",
+ ERB::Util.html_escape(" !\"\#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~"))
+
+ assert_equal("", ERB::Util.html_escape(""))
+ assert_equal("abc", ERB::Util.html_escape("abc"))
+ assert_equal("&lt;&lt;", ERB::Util.html_escape("<<"))
+ end
end
class TestERBCore < Test::Unit::TestCase