diff options
author | usa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2015-05-21 05:12:20 +0000 |
---|---|---|
committer | usa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2015-05-21 05:12:20 +0000 |
commit | 7944b62832cf666282fd605089c4bc170387cee3 (patch) | |
tree | 4cbfcc805eee0af8a262bdab56cc1db21a13f192 /test | |
parent | a2126a678c1b2b3f972872778f267c9461ffc771 (diff) |
merge revision(s) 50444: [Backport #11128]
* lib/net/imap.rb (body_ext_mpart): should work even if body-fld-dsp
is omitted. [ruby-core:69093] [Bug #11128]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_1@50583 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test')
-rw-r--r-- | test/net/imap/test_imap_response_parser.rb | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/test/net/imap/test_imap_response_parser.rb b/test/net/imap/test_imap_response_parser.rb index c4176f7b6c..0c650015f0 100644 --- a/test/net/imap/test_imap_response_parser.rb +++ b/test/net/imap/test_imap_response_parser.rb @@ -258,4 +258,17 @@ EOF assert_equal(empty_part.body.subtype, 'MIXED') assert_equal(empty_part.body.param['BOUNDARY'], '000e0cd29212e3e06a0486590ae2') end + + # [Bug #11128] + def test_body_ext_mpart_without_lang + parser = Net::IMAP::ResponseParser.new + response = parser.parse("* 4 FETCH (BODY (((\"text\" \"plain\" (\"charset\" \"utf-8\") NIL NIL \"7bit\" 257 9 NIL NIL NIL NIL)(\"text\" \"html\" (\"charset\" \"utf-8\") NIL NIL \"quoted-printable\" 655 9 NIL NIL NIL NIL) \"alternative\" (\"boundary\" \"001a1137a5047848dd05157ddaa1\") NIL)(\"application\" \"pdf\" (\"name\" \"test.xml\" \"x-apple-part-url\" \"9D00D9A2-98AB-4EFB-85BA-FB255F8BF3D7\") NIL NIL \"base64\" 4383638 NIL (\"attachment\" (\"filename\" \"test.xml\")) NIL NIL) \"mixed\" (\"boundary\" \"001a1137a5047848e405157ddaa3\") NIL))\r\n") + assert_equal("FETCH", response.name) + body = response.data.attr["BODY"] + assert_equal(nil, body.parts[0].disposition) + assert_equal(nil, body.parts[0].language) + assert_equal("ATTACHMENT", body.parts[1].disposition.dsp_type) + assert_equal("test.xml", body.parts[1].disposition.param["FILENAME"]) + assert_equal(nil, body.parts[1].language) + end end |