diff options
author | kazu <kazu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2010-12-06 10:01:42 +0000 |
---|---|---|
committer | kazu <kazu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2010-12-06 10:01:42 +0000 |
commit | 9600d9693c4e94e2755001e2e10caedcc761a69c (patch) | |
tree | 0c01253dfeab04fdc03c3d0bab9c0279dbc39f64 /test/uri | |
parent | 8d7e9e53437e696e9e121431e96d2755c2106f75 (diff) | |
download | ruby-9600d9693c4e94e2755001e2e10caedcc761a69c.tar.gz |
* test/uri/test_common.rb (TestCommon#test_encode_www_form): add
tests for r30015.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30093 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/uri')
-rw-r--r-- | test/uri/test_common.rb | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/test/uri/test_common.rb b/test/uri/test_common.rb index 2c0bc79cd5..9dc87dcbc5 100644 --- a/test/uri/test_common.rb +++ b/test/uri/test_common.rb @@ -97,6 +97,11 @@ class TestCommon < Test::Unit::TestCase assert_equal('=', URI.encode_www_form([['', '']])) assert_equal('a%26b=1&c=2%3B3&e=4', URI.encode_www_form([['a&b', '1'], ['c', '2;3'], ['e', '4']])) assert_equal('image&title&price', URI.encode_www_form([['image', nil], ['title', nil], ['price', nil]])) + + assert_equal("q=ruby&lang=en", URI.encode_www_form([["q", "ruby"], ["lang", "en"]])) + assert_equal("q=ruby&lang=en", URI.encode_www_form("q" => "ruby", "lang" => "en")) + assert_equal("q=ruby&q=perl&lang=en", URI.encode_www_form("q" => ["ruby", "perl"], "lang" => "en")) + assert_equal("q=ruby&q=perl&lang=en", URI.encode_www_form([["q", "ruby"], ["q", "perl"], ["lang", "en"]])) end def test_decode_www_form |