From 8a180ee4b70cb2816bd89d0df51c9bcfbddf3609 Mon Sep 17 00:00:00 2001 From: nobu Date: Sun, 14 Feb 2016 08:52:38 +0000 Subject: test_cgi_util.rb: test_cgi_unescapeHTML_invalid * test/cgi/test_cgi_util.rb (test_cgi_unescapeHTML_invalid): test for invalid escaped HTML, borrowed from rubyspec. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53823 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- test/cgi/test_cgi_util.rb | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'test/cgi/test_cgi_util.rb') diff --git a/test/cgi/test_cgi_util.rb b/test/cgi/test_cgi_util.rb index f67817fce6..62679b9c82 100644 --- a/test/cgi/test_cgi_util.rb +++ b/test/cgi/test_cgi_util.rb @@ -98,6 +98,10 @@ class CGIUtilTest < Test::Unit::TestCase assert_equal("'&\"><", CGI::unescapeHTML("'&"><")) end + def test_cgi_unescapeHTML_invalid + assert_equal('&<&>"&abcdefghijklmn', CGI::unescapeHTML('&<&>"&abcdefghijklmn')) + end + Encoding.list.each do |enc| begin escaped = "'&"><".encode(enc) -- cgit v1.2.3