@@ -8,14 +8,16 @@ fn gen(alloc: std.mem.Allocator, rand: std.Random) ![]const u8 {
88}
99
1010test "diff - random" {
11- const allocator = std .testing .allocator ;
1211 var rand : std.Random.DefaultPrng = .init (std .testing .random_seed );
13- try testDiff (allocator , rand .random (), .@"utf-8" );
14- try testDiff (allocator , rand .random (), .@"utf-16" );
15- try testDiff (allocator , rand .random (), .@"utf-32" );
12+ try testDiff (rand .random (), .@"utf-8" );
13+ try testDiff (rand .random (), .@"utf-16" );
14+ try testDiff (rand .random (), .@"utf-32" );
1615}
1716
18- fn testDiff (allocator : std.mem.Allocator , rand : std.Random , encoding : zls.offsets.Encoding ) ! void {
17+ fn testDiff (rand : std.Random , encoding : zls.offsets.Encoding ) ! void {
18+ const io = std .testing .io ;
19+ const allocator = std .testing .allocator ;
20+
1921 var buffer : [256 ]u8 = undefined ;
2022 rand .bytes (& buffer );
2123 for (& buffer ) | * c | c .* = '0' + c .* % 32 ;
@@ -24,7 +26,7 @@ fn testDiff(allocator: std.mem.Allocator, rand: std.Random, encoding: zls.offset
2426 const before = buffer [0.. split_index ];
2527 const after = buffer [split_index .. ];
2628
27- var edits = try zls .diff .edits (allocator , before , after , encoding );
29+ var edits = try zls .diff .edits (io , allocator , before , after , encoding );
2830 defer {
2931 for (edits .items ) | edit | allocator .free (edit .newText );
3032 edits .deinit (allocator );
0 commit comments