@@ -42,6 +42,9 @@ def teardown
42
42
############################################################################
43
43
# IMAP extensions, by RFC:
44
44
45
+ # RFC 4315: UIDPLUS extension, APPENDUID and COPYUID response codes
46
+ generate_tests_from fixture_file : "uidplus_extension.yml"
47
+
45
48
# RFC 5256: THREAD response
46
49
generate_tests_from fixture_file : "thread_responses.yml"
47
50
@@ -208,59 +211,6 @@ def test_ignored_response
208
211
assert_instance_of ( Net ::IMAP ::IgnoredResponse , response )
209
212
end
210
213
211
- def test_uidplus_appenduid
212
- parser = Net ::IMAP ::ResponseParser . new
213
- # RFC4315 example
214
- response = parser . parse (
215
- "A003 OK [APPENDUID 38505 3955] APPEND completed\r \n "
216
- )
217
- code = response . data . code
218
- assert_equal "APPENDUID" , code . name
219
- assert_kind_of Net ::IMAP ::UIDPlusData , code . data
220
- assert_equal Net ::IMAP ::UIDPlusData . new ( 38505 , nil , [ 3955 ] ) , code . data
221
- assert_equal "APPENDUID" , code . name
222
- assert_kind_of Net ::IMAP ::UIDPlusData , code . data
223
- assert_equal Net ::IMAP ::UIDPlusData . new ( 38505 , nil , [ 3955 ] ) , code . data
224
- # MULTIAPPEND compatibility:
225
- response = parser . parse (
226
- "A003 OK [APPENDUID 2 4,6:7,9] APPEND completed\r \n "
227
- )
228
- code = response . data . code
229
- assert_equal "APPENDUID" , code . name
230
- assert_kind_of Net ::IMAP ::UIDPlusData , code . data
231
- assert_equal Net ::IMAP ::UIDPlusData . new ( 2 , nil , [ 4 , 6 , 7 , 9 ] ) , code . data
232
- end
233
-
234
- def test_uidplus_copyuid
235
- parser = Net ::IMAP ::ResponseParser . new
236
- # RFC4315 example, but using mixed case "copyUID".
237
- response = parser . parse (
238
- "A004 OK [copyUID 38505 304,319:320 3956:3958] Done\r \n "
239
- )
240
- code = response . data . code
241
- assert_equal "COPYUID" , code . name
242
- assert_kind_of Net ::IMAP ::UIDPlusData , code . data
243
- assert_equal Net ::IMAP ::UIDPlusData . new (
244
- 38505 , [ 304 , 319 , 320 ] , [ 3956 , 3957 , 3958 ]
245
- ) , code . data
246
- end
247
-
248
- # From RFC4315 ABNF:
249
- # > and all values between these two *regardless of order*.
250
- # > Example: 2:4 and 4:2 are equivalent.
251
- def test_uidplus_copyuid__reversed_ranges
252
- parser = Net ::IMAP ::ResponseParser . new
253
- response = parser . parse (
254
- "A004 OK [copyUID 9999 20:19,500:495 92:97,101:100] Done\r \n "
255
- )
256
- code = response . data . code
257
- assert_equal Net ::IMAP ::UIDPlusData . new (
258
- 9999 ,
259
- [ 19 , 20 , 495 , 496 , 497 , 498 , 499 , 500 ] ,
260
- [ 92 , 93 , 94 , 95 , 96 , 97 , 100 , 101 ]
261
- ) , code . data
262
- end
263
-
264
214
def test_uidplus_copyuid__uid_mapping
265
215
parser = Net ::IMAP ::ResponseParser . new
266
216
response = parser . parse (
0 commit comments