diff options
| -rw-r--r-- | ChangeLog | 5 | ||||
| -rw-r--r-- | test/uri/test_common.rb | 5 |
2 files changed, 10 insertions, 0 deletions
@@ -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 |
