453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
|
[s[0] deleteCharactersInRange: of_range(2, 2)];
})
EXPECT_EXCEPTION(@"Detect OoR in -[deleteCharactersInRange:] #2",
OFOutOfRangeException,
[s[0] deleteCharactersInRange: of_range(4, 0)])
EXPECT_EXCEPTION(@"Detect OoR in -[replaceCharactersInRange:withString:] #1",
OFOutOfRangeException,
[s[0] replaceCharactersInRange: of_range(2, 2)
withString: @""])
EXPECT_EXCEPTION(@"Detect OoR in -[replaceCharactersInRange:withString:] #2",
OFOutOfRangeException,
[s[0] replaceCharactersInRange: of_range(4, 0)
withString: @""])
TEST(@"-[replaceOccurrencesOfString:withString:]",
(s[0] = [OFMutableString stringWithString:
@"asd fo asd fofo asd"]) &&
|
|
>
|
>
|
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
|
[s[0] deleteCharactersInRange: of_range(2, 2)];
})
EXPECT_EXCEPTION(@"Detect OoR in -[deleteCharactersInRange:] #2",
OFOutOfRangeException,
[s[0] deleteCharactersInRange: of_range(4, 0)])
EXPECT_EXCEPTION(@"Detect OoR in "
@"-[replaceCharactersInRange:withString:] #1",
OFOutOfRangeException,
[s[0] replaceCharactersInRange: of_range(2, 2)
withString: @""])
EXPECT_EXCEPTION(@"Detect OoR in "
@"-[replaceCharactersInRange:withString:] #2",
OFOutOfRangeException,
[s[0] replaceCharactersInRange: of_range(4, 0)
withString: @""])
TEST(@"-[replaceOccurrencesOfString:withString:]",
(s[0] = [OFMutableString stringWithString:
@"asd fo asd fofo asd"]) &&
|