summaryrefslogtreecommitdiff
path: root/test/net/imap
diff options
context:
space:
mode:
authorshugo <shugo@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-03-16 04:56:18 +0000
committershugo <shugo@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-03-16 04:56:18 +0000
commited07df5ab5e183aed62cbe33f50a57640617d7a4 (patch)
tree480a7ea5ab934a9cd7876cb372f51c6b71a11e96 /test/net/imap
parent5308538befe847d3b9774257a54d9c4d5b47bd94 (diff)
* lib/net/imap.rb (rfc822_text): ignore [] after RFC822.
[ruby-core:40945] [Bug #5620] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35054 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/net/imap')
-rw-r--r--test/net/imap/test_imap_response_parser.rb16
1 files changed, 16 insertions, 0 deletions
diff --git a/test/net/imap/test_imap_response_parser.rb b/test/net/imap/test_imap_response_parser.rb
index 3f26e0b350..b4d36c9091 100644
--- a/test/net/imap/test_imap_response_parser.rb
+++ b/test/net/imap/test_imap_response_parser.rb
@@ -126,4 +126,20 @@ EOF
}
assert_match(/ for \{123\}/, e.message)
end
+
+ def test_msg_att_rfc822_text
+ parser = Net::IMAP::ResponseParser.new
+ response = parser.parse(<<EOF.gsub(/\n/, "\r\n").taint)
+* 123 FETCH (RFC822 {5}
+foo
+)
+EOF
+ assert_equal("foo\r\n", response.data.attr["RFC822"])
+ response = parser.parse(<<EOF.gsub(/\n/, "\r\n").taint)
+* 123 FETCH (RFC822[] {5}
+foo
+)
+EOF
+ assert_equal("foo\r\n", response.data.attr["RFC822"])
+ end
end