diff options
author | shugo <shugo@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2011-06-16 02:41:03 +0000 |
---|---|---|
committer | shugo <shugo@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2011-06-16 02:41:03 +0000 |
commit | 97ac172d58d695305c39d555155318edb99f1ea7 (patch) | |
tree | c4594153908bb5ec395110255e573af026af2b76 /test/net/imap | |
parent | 685444569cb747b399e0ab087e5876fad08a71bb (diff) | |
download | ruby-97ac172d58d695305c39d555155318edb99f1ea7.tar.gz |
* lib/net/imap.rb (search_response): parses SEARCH responses from
the Yahoo IMAP server correctly. patched by Mark Nadig. [Bug #4509]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32114 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/net/imap')
-rw-r--r-- | test/net/imap/test_imap_response_parser.rb | 29 |
1 files changed, 28 insertions, 1 deletions
diff --git a/test/net/imap/test_imap_response_parser.rb b/test/net/imap/test_imap_response_parser.rb index 599747dd76..ccdffd21ca 100644 --- a/test/net/imap/test_imap_response_parser.rb +++ b/test/net/imap/test_imap_response_parser.rb @@ -64,7 +64,6 @@ EOF assert_equal [:Inbox], response.data.attr end - def test_resp_text_code parser = Net::IMAP::ResponseParser.new response = parser.parse(<<EOF.gsub(/\n/, "\r\n").taint) @@ -72,4 +71,32 @@ EOF EOF assert_equal "CLOSED", response.data.code.name end + + def test_search_response + parser = Net::IMAP::ResponseParser.new + response = parser.parse(<<EOF.gsub(/\n/, "\r\n").taint) +* SEARCH +EOF + assert_equal [], response.data + response = parser.parse(<<EOF.gsub(/\n/, "\r\n").taint) +* SEARCH 1 +EOF + assert_equal [1], response.data + response = parser.parse(<<EOF.gsub(/\n/, "\r\n").taint) +* SEARCH 1 2 3 +EOF + assert_equal [1, 2, 3], response.data + end + + def test_search_response_of_yahoo + parser = Net::IMAP::ResponseParser.new + response = parser.parse(<<EOF.gsub(/\n/, "\r\n").taint) +* SEARCH 1 +EOF + assert_equal [1], response.data + response = parser.parse(<<EOF.gsub(/\n/, "\r\n").taint) +* SEARCH 1 2 3 +EOF + assert_equal [1, 2, 3], response.data + end end |