diff options
author | naruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2010-04-10 22:05:02 +0000 |
---|---|---|
committer | naruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2010-04-10 22:05:02 +0000 |
commit | 9e30f60dbf26d2c628fd8601bc0cc496c8c77db0 (patch) | |
tree | 668924817047bdbda3cd1a5eee4666de5d8bf879 /test/uri | |
parent | a31507939004778e39af5da92bcd6b295b86c11d (diff) |
* lib/uri/common.rb (decode_www_form_component): validate.
[ruby-dev:40938]
* lib/uri/common.rb (decode_www_form): allow empty string.
* lib/uri/common.rb: fix nodoc for constant. [ruby-dev:40949]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27285 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/uri')
-rw-r--r-- | test/uri/test_common.rb | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/test/uri/test_common.rb b/test/uri/test_common.rb index 5e575e21a6..01381b20e6 100644 --- a/test/uri/test_common.rb +++ b/test/uri/test_common.rb @@ -69,6 +69,7 @@ class TestCommon < Test::Unit::TestCase "AZ%5B%5C%5D%5E_%60az%7B%7C%7D%7E")) assert_equal("\xA1\xA2".force_encoding(Encoding::EUC_JP), URI.decode_www_form_component("%A1%A2", "EUC-JP")) + assert_raise(ArgumentError){URI.decode_www_form_component("%")} end def test_encode_www_form @@ -88,6 +89,7 @@ class TestCommon < Test::Unit::TestCase assert_equal([%w[a 1], ["\u3042", "\u6F22"]], URI.decode_www_form("a=1;%E3%81%82=%E6%BC%A2")) assert_equal([%w[?a 1], %w[a 2]], URI.decode_www_form("?a=1&a=2")) + assert_equal([], URI.decode_www_form("")) assert_raise(ArgumentError){URI.decode_www_form("%=1")} assert_raise(ArgumentError){URI.decode_www_form("a=%")} assert_raise(ArgumentError){URI.decode_www_form("a=1&%=2")} |