aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorkazu <kazu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2010-12-06 10:01:42 +0000
committerkazu <kazu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2010-12-06 10:01:42 +0000
commit9600d9693c4e94e2755001e2e10caedcc761a69c (patch)
tree0c01253dfeab04fdc03c3d0bab9c0279dbc39f64
parent8d7e9e53437e696e9e121431e96d2755c2106f75 (diff)
downloadruby-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
-rw-r--r--ChangeLog5
-rw-r--r--test/uri/test_common.rb5
2 files changed, 10 insertions, 0 deletions
diff --git a/ChangeLog b/ChangeLog
index 056567ff86..dbfa7c28b2 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+Mon Dec 6 18:55:36 2010 Kazuhiro NISHIYAMA <zn@mbf.nifty.com>
+
+ * test/uri/test_common.rb (TestCommon#test_encode_www_form): add
+ tests for r30015.
+
Mon Dec 6 10:39:54 2010 NARUSE, Yui <naruse@ruby-lang.org>
* lib/uri/common.rb (URI::Parser#initialize_pattern):
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