aboutsummaryrefslogtreecommitdiffstats
path: root/test/uri
diff options
context:
space:
mode:
Diffstat (limited to 'test/uri')
-rw-r--r--test/uri/test_common.rb5
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