@@ -201,51 +201,6 @@ def test_fetch_binary_and_binary_size
201201 end
202202 end
203203
204- test "APPENDUID with parser_use_deprecated_uidplus_data = true" do
205- parser = Net ::IMAP ::ResponseParser . new ( config : {
206- parser_use_deprecated_uidplus_data : true ,
207- parser_max_deprecated_uidplus_data_size : 10_000 ,
208- } )
209- assert_raise_with_message Net ::IMAP ::ResponseParseError , /uid-set is too large/ do
210- parser . parse (
211- "A004 OK [APPENDUID 1 10000:20000,1] Done\r \n "
212- )
213- end
214- response = parser . parse ( "A004 OK [APPENDUID 1 100:200] Done\r \n " )
215- uidplus = response . data . code . data
216- assert_equal 101 , uidplus . assigned_uids . size
217- parser . config . parser_max_deprecated_uidplus_data_size = 100
218- assert_raise_with_message Net ::IMAP ::ResponseParseError , /uid-set is too large/ do
219- parser . parse (
220- "A004 OK [APPENDUID 1 100:200] Done\r \n "
221- )
222- end
223- response = parser . parse ( "A004 OK [APPENDUID 1 101:200] Done\r \n " )
224- uidplus = response . data . code . data
225- assert_instance_of Net ::IMAP ::UIDPlusData , uidplus
226- assert_equal 100 , uidplus . assigned_uids . size
227- end
228-
229- test "APPENDUID with parser_use_deprecated_uidplus_data = :up_to_max_size" do
230- parser = Net ::IMAP ::ResponseParser . new ( config : {
231- parser_use_deprecated_uidplus_data : :up_to_max_size ,
232- parser_max_deprecated_uidplus_data_size : 100
233- } )
234- response = parser . parse ( "A004 OK [APPENDUID 1 101:200] Done\r \n " )
235- assert_instance_of Net ::IMAP ::UIDPlusData , response . data . code . data
236- response = parser . parse ( "A004 OK [APPENDUID 1 100:200] Done\r \n " )
237- assert_instance_of Net ::IMAP ::AppendUIDData , response . data . code . data
238- end
239-
240- test "APPENDUID with parser_use_deprecated_uidplus_data = false" do
241- parser = Net ::IMAP ::ResponseParser . new ( config : {
242- parser_use_deprecated_uidplus_data : false ,
243- parser_max_deprecated_uidplus_data_size : 10_000_000 ,
244- } )
245- response = parser . parse ( "A004 OK [APPENDUID 1 10] Done\r \n " )
246- assert_instance_of Net ::IMAP ::AppendUIDData , response . data . code . data
247- end
248-
249204 test "COPYUID with backwards ranges" do
250205 parser = Net ::IMAP ::ResponseParser . new
251206 response = parser . parse (
@@ -276,53 +231,4 @@ def test_fetch_binary_and_binary_size
276231 end
277232 end
278233
279- test "COPYUID with parser_use_deprecated_uidplus_data = true" do
280- parser = Net ::IMAP ::ResponseParser . new ( config : {
281- parser_use_deprecated_uidplus_data : true ,
282- parser_max_deprecated_uidplus_data_size : 10_000 ,
283- } )
284- assert_raise_with_message Net ::IMAP ::ResponseParseError , /uid-set is too large/ do
285- parser . parse (
286- "A004 OK [copyUID 1 10000:20000,1 1:10001] Done\r \n "
287- )
288- end
289- response = parser . parse ( "A004 OK [copyUID 1 100:200 1:101] Done\r \n " )
290- uidplus = response . data . code . data
291- assert_equal 101 , uidplus . assigned_uids . size
292- assert_equal 101 , uidplus . source_uids . size
293- parser . config . parser_max_deprecated_uidplus_data_size = 100
294- assert_raise_with_message Net ::IMAP ::ResponseParseError , /uid-set is too large/ do
295- parser . parse (
296- "A004 OK [copyUID 1 100:200 1:101] Done\r \n "
297- )
298- end
299- response = parser . parse ( "A004 OK [copyUID 1 101:200 1:100] Done\r \n " )
300- uidplus = response . data . code . data
301- assert_instance_of Net ::IMAP ::UIDPlusData , uidplus
302- assert_equal 100 , uidplus . assigned_uids . size
303- assert_equal 100 , uidplus . source_uids . size
304- end
305-
306- test "COPYUID with parser_use_deprecated_uidplus_data = :up_to_max_size" do
307- parser = Net ::IMAP ::ResponseParser . new ( config : {
308- parser_use_deprecated_uidplus_data : :up_to_max_size ,
309- parser_max_deprecated_uidplus_data_size : 100
310- } )
311- response = parser . parse ( "A004 OK [COPYUID 1 101:200 1:100] Done\r \n " )
312- copyuid = response . data . code . data
313- assert_instance_of Net ::IMAP ::UIDPlusData , copyuid
314- response = parser . parse ( "A004 OK [COPYUID 1 100:200 1:101] Done\r \n " )
315- copyuid = response . data . code . data
316- assert_instance_of Net ::IMAP ::CopyUIDData , copyuid
317- end
318-
319- test "COPYUID with parser_use_deprecated_uidplus_data = false" do
320- parser = Net ::IMAP ::ResponseParser . new ( config : {
321- parser_use_deprecated_uidplus_data : false ,
322- parser_max_deprecated_uidplus_data_size : 10_000_000 ,
323- } )
324- response = parser . parse ( "A004 OK [COPYUID 1 101 1] Done\r \n " )
325- assert_instance_of Net ::IMAP ::CopyUIDData , response . data . code . data
326- end
327-
328234end
0 commit comments