File tree Expand file tree Collapse file tree 1 file changed +16
-0
lines changed Expand file tree Collapse file tree 1 file changed +16
-0
lines changed Original file line number Diff line number Diff line change @@ -765,6 +765,22 @@ - (void)test_diff_deltaTest {
765765 expectedResult = [dmp diff_fromDeltaWithText: @" " andDelta: delta error: NULL ];
766766 XCTAssertEqualObjects (diffs, expectedResult, @" diff_fromDelta: Unchanged characters. Convert delta string into a diff." );
767767
768+ // 160 kb string.
769+ NSString *a = @" abcdefghij" ;
770+ NSMutableString *aMutable = [NSMutableString stringWithString: a];
771+ for (int i = 0 ; i < 14 ; i++) {
772+ [aMutable appendString: aMutable];
773+ }
774+ a = aMutable;
775+ diffs = [NSMutableArray arrayWithObject:
776+ [Diff diffWithOperation: DIFF_INSERT andText: a]];
777+ delta = [dmp diff_toDelta: diffs];
778+ XCTAssertEqualObjects ([@" +" stringByAppendingString: a], delta, @" diff_toDelta: 160kb string." );
779+
780+ // Convert delta string into a diff.
781+ expectedResult = [dmp diff_fromDeltaWithText: @" " andDelta: delta error: NULL ];
782+ XCTAssertEqualObjects (diffs, expectedResult, @" diff_fromDelta: 160kb string. Convert delta string into a diff." );
783+
768784 [dmp release ];
769785}
770786
You can’t perform that action at this time.
0 commit comments