@@ -796,7 +796,7 @@ fn diffBisectSplit(
796796 .delete ,
797797 try allocator .dupe (
798798 u8 ,
799- text2b ,
799+ text1b ,
800800 ),
801801 ));
802802 diffs .appendAssumeCapacity (Diff .init (
@@ -815,7 +815,7 @@ fn diffBisectSplit(
815815 .delete ,
816816 try allocator .dupe (
817817 u8 ,
818- text2a ,
818+ text2b ,
819819 ),
820820 ));
821821 diffs .appendAssumeCapacity (Diff .init (
@@ -4635,26 +4635,12 @@ test "Unicode diffs" {
46354635 const after = "<r>red</r>♦︎ <b>blue</b>♦︎<t>∅ </t><g>green</g>♦︎<t>∅</t>♦︎ <y>yellow</y>" ;
46364636 var diffs = try dmp .diff (allocator , before , after , false );
46374637 defer deinitDiffList (allocator , & diffs );
4638- }
4639- }
4640-
4641- test "Workshop" {
4642- const allocator = std .testing .allocator ;
4643- var dmp = DiffMatchPatch {};
4644- dmp .diff_timeout = 0 ;
4645- {
4646- const before = "<r>red</r> <t></t><b>blue</b><t> </t><g>green</g><t></t> <y>yellow</y>" ;
4647- const after = "<r>red</r>♦︎ <b>blue</b>♦︎<t>∅ </t><g>green</g>♦︎<t>∅</t>♦︎ <y>yellow</y>" ;
4648- var diffs = try dmp .diff (allocator , before , after , false );
4649- defer deinitDiffList (allocator , & diffs );
4650- for (diffs .items ) | a_diff | {
4651- std .debug .print ("{}\n " , .{a_diff });
4652- std .debug .print (" {any}\n " , .{a_diff .text });
4653- }
46544638 const before_2 = try diffBeforeText (allocator , diffs );
4655- std .debug .print ("{s}\n " , .{before_2 });
46564639 defer allocator .free (before_2 );
46574640 try testing .expectEqualStrings (before , before_2 );
4641+ const after_2 = try diffAfterText (allocator , diffs );
4642+ defer allocator .free (after_2 );
4643+ try testing .expectEqualStrings (after , after_2 );
46584644 }
46594645}
46604646
0 commit comments