mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* 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
This commit is contained in:
parent
685444569c
commit
97ac172d58
3 changed files with 35 additions and 2 deletions
|
@ -1,3 +1,8 @@
|
||||||
|
Thu Jun 16 11:35:09 2011 Shugo Maeda <shugo@ruby-lang.org>
|
||||||
|
|
||||||
|
* lib/net/imap.rb (search_response): parses SEARCH responses from
|
||||||
|
the Yahoo IMAP server correctly. patched by Mark Nadig. [Bug #4509]
|
||||||
|
|
||||||
Thu Jun 16 09:12:38 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
Thu Jun 16 09:12:38 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
||||||
|
|
||||||
* fix for build on solaris 10.
|
* fix for build on solaris 10.
|
||||||
|
|
|
@ -2748,9 +2748,10 @@ module Net
|
||||||
break
|
break
|
||||||
when T_SPACE
|
when T_SPACE
|
||||||
shift_token
|
shift_token
|
||||||
end
|
else
|
||||||
data.push(number)
|
data.push(number)
|
||||||
end
|
end
|
||||||
|
end
|
||||||
else
|
else
|
||||||
data = []
|
data = []
|
||||||
end
|
end
|
||||||
|
|
|
@ -64,7 +64,6 @@ EOF
|
||||||
assert_equal [:Inbox], response.data.attr
|
assert_equal [:Inbox], response.data.attr
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
def test_resp_text_code
|
def test_resp_text_code
|
||||||
parser = Net::IMAP::ResponseParser.new
|
parser = Net::IMAP::ResponseParser.new
|
||||||
response = parser.parse(<<EOF.gsub(/\n/, "\r\n").taint)
|
response = parser.parse(<<EOF.gsub(/\n/, "\r\n").taint)
|
||||||
|
@ -72,4 +71,32 @@ EOF
|
||||||
EOF
|
EOF
|
||||||
assert_equal "CLOSED", response.data.code.name
|
assert_equal "CLOSED", response.data.code.name
|
||||||
end
|
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
|
end
|
||||||
|
|
Loading…
Reference in a new issue