summaryrefslogtreecommitdiff
path: root/test/cgi/test_cgi_core.rb
diff options
context:
space:
mode:
authorxibbar <xibbar@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-09-28 14:55:59 +0000
committerxibbar <xibbar@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-09-28 14:55:59 +0000
commit645a0eb8ec7c71f7635207580e3fd90837e0d8cc (patch)
tree65535b6ef833a16ae2677c4d94b088a516b32630 /test/cgi/test_cgi_core.rb
parentc0f84528c7d0d3a53eed497a92a91ba096affb81 (diff)
add a test
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19615 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/cgi/test_cgi_core.rb')
-rwxr-xr-xtest/cgi/test_cgi_core.rb13
1 files changed, 13 insertions, 0 deletions
diff --git a/test/cgi/test_cgi_core.rb b/test/cgi/test_cgi_core.rb
index 9e6e61819ab..9d626c7ff14 100755
--- a/test/cgi/test_cgi_core.rb
+++ b/test/cgi/test_cgi_core.rb
@@ -21,6 +21,19 @@ class CGICoreTest < Test::Unit::TestCase
$stdout = STDOUT
end
+ def test_cgi_parse_illegal_query
+ @environ = {
+ 'REQUEST_METHOD' => 'GET',
+ 'QUERY_STRING' => 'a=111&&b=222&c&d=',
+ 'HTTP_COOKIE' => '_session_id=12345; name1=val1&val2;',
+ 'SERVER_SOFTWARE' => 'Apache 2.2.0',
+ 'SERVER_PROTOCOL' => 'HTTP/1.1',
+ }
+ ENV.update(@environ)
+ cgi = CGI.new
+ assert_equal(["a","b","d"],cgi.keys.sort) if RUBY_VERSION>="1.9"
+ assert_equal("",cgi["d"])
+ end
def test_cgi_core_params_GET
@environ = {