summaryrefslogtreecommitdiff
path: root/test/cgi/test_cgi_util.rb
diff options
context:
space:
mode:
Diffstat (limited to 'test/cgi/test_cgi_util.rb')
-rw-r--r--test/cgi/test_cgi_util.rb10
1 files changed, 10 insertions, 0 deletions
diff --git a/test/cgi/test_cgi_util.rb b/test/cgi/test_cgi_util.rb
index d30c9bd..08c2ed2 100644
--- a/test/cgi/test_cgi_util.rb
+++ b/test/cgi/test_cgi_util.rb
@@ -68,6 +68,16 @@ class CGIUtilTest < Test::Unit::TestCase
assert_equal(Encoding::UTF_8, CGI::escapeHTML("'&\"><".force_encoding("UTF-8")).encoding)
end
+ def test_cgi_escape_html_preserve_tainted
+ assert_equal(false, CGI::escapeHTML("'&\"><").tainted?)
+ assert_equal(true, CGI::escapeHTML("'&\"><".taint).tainted?)
+ end
+
+ def test_cgi_escape_html_preserve_frozen
+ assert_equal(false, CGI::escapeHTML("'&\"><".dup).frozen?)
+ assert_equal(true, CGI::escapeHTML("'&\"><".freeze).frozen?)
+ end
+
def test_cgi_unescapeHTML
assert_equal("'&\"><", CGI::unescapeHTML("&#39;&amp;&quot;&gt;&lt;"))
end