ruby-changes:29039
From: shugo <ko1@a...>
Date: Wed, 5 Jun 2013 22:44:29 +0900 (JST)
Subject: [ruby-changes:29039] shugo:r41091 (trunk): * lib/net/imap.rb (capability_response): should ignore trailing
shugo 2013-06-05 22:44:17 +0900 (Wed, 05 Jun 2013) New Revision: 41091 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=41091 Log: * lib/net/imap.rb (capability_response): should ignore trailing spaces. Thanks, Peter Kovacs. [ruby-core:55024] [Bug #8415] * test/net/imap/test_imap_response_parser.rb: related test. Modified files: trunk/ChangeLog trunk/lib/net/imap.rb trunk/test/net/imap/test_imap_response_parser.rb Index: ChangeLog =================================================================== --- ChangeLog (revision 41090) +++ ChangeLog (revision 41091) @@ -1,3 +1,10 @@ https://github.com/ruby/ruby/blob/trunk/ChangeLog#L1 +Wed Jun 5 22:40:42 2013 Shugo Maeda <shugo@r...> + + * lib/net/imap.rb (capability_response): should ignore trailing + spaces. Thanks, Peter Kovacs. [ruby-core:55024] [Bug #8415] + + * test/net/imap/test_imap_response_parser.rb: related test. + Wed Jun 5 21:17:08 2013 Tanaka Akira <akr@f...> * bignum.c (big_fdiv): Use nlz() instead of bdigbitsize(). Index: lib/net/imap.rb =================================================================== --- lib/net/imap.rb (revision 41090) +++ lib/net/imap.rb (revision 41091) @@ -2953,6 +2953,7 @@ module Net https://github.com/ruby/ruby/blob/trunk/lib/net/imap.rb#L2953 break when T_SPACE shift_token + next end data.push(atom.upcase) end Index: test/net/imap/test_imap_response_parser.rb =================================================================== --- test/net/imap/test_imap_response_parser.rb (revision 41090) +++ test/net/imap/test_imap_response_parser.rb (revision 41091) @@ -237,4 +237,15 @@ EOF https://github.com/ruby/ruby/blob/trunk/test/net/imap/test_imap_response_parser.rb#L237 response.data[0].user) assert_equal("lrswickxteda", response.data[0].rights) end + + # [Bug #8415] + def test_capability + parser = Net::IMAP::ResponseParser.new + response = parser.parse("* CAPABILITY st11p00mm-iscream009 1Q49 XAPPLEPUSHSERVICE IMAP4 IMAP4rev1 SASL-IR AUTH=ATOKEN AUTH=PLAIN\r\n") + assert_equal("CAPABILITY", response.name) + assert_equal("AUTH=PLAIN", response.data.last) + response = parser.parse("* CAPABILITY st11p00mm-iscream009 1Q49 XAPPLEPUSHSERVICE IMAP4 IMAP4rev1 SASL-IR AUTH=ATOKEN AUTH=PLAIN \r\n") + assert_equal("CAPABILITY", response.name) + assert_equal("AUTH=PLAIN", response.data.last) + end end -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/