ObjFW  Diff

Differences From Artifact [ac5088ce3b]:

To Artifact [d0b2683202]:


400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420



















421
422
423
424
425
426
427
				    withString: @""]) &&
	    [s[0] isEqual: @""])

	EXPECT_EXCEPTION(@"Detect OoR in "
	    @"-[deleteCharactersFromIndex:toIndex:] #1", OFOutOfRangeException,
	    {
		s[0] = [OFMutableString stringWithString: @"π„žΓΆΓΆ"];
		[s[0] substringFromIndex: 2
				 toIndex: 4];
	    })

	EXPECT_EXCEPTION(@"Detect OoR in "
	    @"-[deleteCharactersFromIndex:toIndex:] #2", OFOutOfRangeException,
	    [s[0] substringFromIndex: 4
			     toIndex: 4])

	EXPECT_EXCEPTION(@"Detect s > e in "
	    @"-[deleteCharactersFromIndex:toIndex:]",
	    OFInvalidArgumentException,
	    [s[0] substringFromIndex: 2
			     toIndex: 0])




















	TEST(@"-[replaceOccurrencesOfString:withString:]",
	    (s[0] = [OFMutableString stringWithString:
	    @"asd fo asd fofo asd"]) &&
	    R([s[0] replaceOccurrencesOfString: @"fo"
				    withString: @"foo"]) &&
	    [s[0] isEqual: @"asd foo asd foofoo asd"] &&







|
|




|
|




|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>







400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
				    withString: @""]) &&
	    [s[0] isEqual: @""])

	EXPECT_EXCEPTION(@"Detect OoR in "
	    @"-[deleteCharactersFromIndex:toIndex:] #1", OFOutOfRangeException,
	    {
		s[0] = [OFMutableString stringWithString: @"π„žΓΆΓΆ"];
		[s[0] deleteCharactersFromIndex: 2
					toIndex: 4];
	    })

	EXPECT_EXCEPTION(@"Detect OoR in "
	    @"-[deleteCharactersFromIndex:toIndex:] #2", OFOutOfRangeException,
	    [s[0] deleteCharactersFromIndex: 4
				    toIndex: 4])

	EXPECT_EXCEPTION(@"Detect s > e in "
	    @"-[deleteCharactersFromIndex:toIndex:]",
	    OFInvalidArgumentException,
	    [s[0] deleteCharactersFromIndex: 2
				    toIndex: 0])

	EXPECT_EXCEPTION(@"OoR "
	    @"-[replaceCharactersFromIndex:toIndex:withString:] #1",
	    OFOutOfRangeException, [s[0] replaceCharactersFromIndex: 2
							    toIndex: 4
							 withString: @""])

	EXPECT_EXCEPTION(@"OoR "
	    @"-[replaceCharactersFromIndex:toIndex:withString:] #2",
	    OFOutOfRangeException,
	    [s[0] replaceCharactersFromIndex: 4
				     toIndex: 4
				  withString: @""])

	EXPECT_EXCEPTION(@"s>e in "
	    @"-[replaceCharactersFromIndex:toIndex:withString:]",
	    OFInvalidArgumentException, [s[0] replaceCharactersFromIndex: 2
								 toIndex: 0
							      withString: @""])

	TEST(@"-[replaceOccurrencesOfString:withString:]",
	    (s[0] = [OFMutableString stringWithString:
	    @"asd fo asd fofo asd"]) &&
	    R([s[0] replaceOccurrencesOfString: @"fo"
				    withString: @"foo"]) &&
	    [s[0] isEqual: @"asd foo asd foofoo asd"] &&