@@ -1622,10 +1622,10 @@ test "hexToBytes" {
1622
1622
test "formatIntValue with comptime_int" {
1623
1623
const value : comptime_int = 123456789123456789 ;
1624
1624
1625
- var buf = try std .Buffer .init (std .testing .allocator , "" );
1625
+ var buf = std .ArrayList ( u8 ) .init (std .testing .allocator );
1626
1626
defer buf .deinit ();
1627
- try formatIntValue (value , "" , FormatOptions {}, & buf , @TypeOf (std .Buffer . append ).ReturnType .ErrorSet , std .Buffer . append );
1628
- std .testing .expect (mem .eql (u8 , buf .toSlice (), "123456789123456789" ));
1627
+ try formatIntValue (value , "" , FormatOptions {}, & buf , @TypeOf (std .ArrayList ( u8 ). appendSlice ).ReturnType .ErrorSet , std .ArrayList ( u8 ). appendSlice );
1628
+ std .testing .expect (mem .eql (u8 , buf .toSliceConst (), "123456789123456789" ));
1629
1629
}
1630
1630
1631
1631
test "formatType max_depth" {
@@ -1677,24 +1677,24 @@ test "formatType max_depth" {
1677
1677
inst .a = & inst ;
1678
1678
inst .tu .ptr = & inst .tu ;
1679
1679
1680
- var buf0 = try std .Buffer .init (std .testing .allocator , "" );
1680
+ var buf0 = std .ArrayList ( u8 ) .init (std .testing .allocator );
1681
1681
defer buf0 .deinit ();
1682
- try formatType (inst , "" , FormatOptions {}, & buf0 , @TypeOf (std .Buffer . append ).ReturnType .ErrorSet , std .Buffer . append , 0 );
1682
+ try formatType (inst , "" , FormatOptions {}, & buf0 , @TypeOf (std .ArrayList ( u8 ). appendSlice ).ReturnType .ErrorSet , std .ArrayList ( u8 ). appendSlice , 0 );
1683
1683
std .testing .expect (mem .eql (u8 , buf0 .toSlice (), "S{ ... }" ));
1684
1684
1685
- var buf1 = try std .Buffer .init (std .testing .allocator , "" );
1685
+ var buf1 = std .ArrayList ( u8 ) .init (std .testing .allocator );
1686
1686
defer buf1 .deinit ();
1687
- try formatType (inst , "" , FormatOptions {}, & buf1 , @TypeOf (std .Buffer . append ).ReturnType .ErrorSet , std .Buffer . append , 1 );
1687
+ try formatType (inst , "" , FormatOptions {}, & buf1 , @TypeOf (std .ArrayList ( u8 ). appendSlice ).ReturnType .ErrorSet , std .ArrayList ( u8 ). appendSlice , 1 );
1688
1688
std .testing .expect (mem .eql (u8 , buf1 .toSlice (), "S{ .a = S{ ... }, .tu = TU{ ... }, .e = E.Two, .vec = (10.200,2.220) }" ));
1689
1689
1690
- var buf2 = try std .Buffer .init (std .testing .allocator , "" );
1690
+ var buf2 = std .ArrayList ( u8 ) .init (std .testing .allocator );
1691
1691
defer buf2 .deinit ();
1692
- try formatType (inst , "" , FormatOptions {}, & buf2 , @TypeOf (std .Buffer . append ).ReturnType .ErrorSet , std .Buffer . append , 2 );
1692
+ try formatType (inst , "" , FormatOptions {}, & buf2 , @TypeOf (std .ArrayList ( u8 ). appendSlice ).ReturnType .ErrorSet , std .ArrayList ( u8 ). appendSlice , 2 );
1693
1693
std .testing .expect (mem .eql (u8 , buf2 .toSlice (), "S{ .a = S{ .a = S{ ... }, .tu = TU{ ... }, .e = E.Two, .vec = (10.200,2.220) }, .tu = TU{ .ptr = TU{ ... } }, .e = E.Two, .vec = (10.200,2.220) }" ));
1694
1694
1695
- var buf3 = try std .Buffer .init (std .testing .allocator , "" );
1695
+ var buf3 = std .ArrayList ( u8 ) .init (std .testing .allocator );
1696
1696
defer buf3 .deinit ();
1697
- try formatType (inst , "" , FormatOptions {}, & buf3 , @TypeOf (std .Buffer . append ).ReturnType .ErrorSet , std .Buffer . append , 3 );
1697
+ try formatType (inst , "" , FormatOptions {}, & buf3 , @TypeOf (std .ArrayList ( u8 ). appendSlice ).ReturnType .ErrorSet , std .ArrayList ( u8 ). appendSlice , 3 );
1698
1698
std .testing .expect (mem .eql (u8 , buf3 .toSlice (), "S{ .a = S{ .a = S{ .a = S{ ... }, .tu = TU{ ... }, .e = E.Two, .vec = (10.200,2.220) }, .tu = TU{ .ptr = TU{ ... } }, .e = E.Two, .vec = (10.200,2.220) }, .tu = TU{ .ptr = TU{ .ptr = TU{ ... } } }, .e = E.Two, .vec = (10.200,2.220) }" ));
1699
1699
}
1700
1700
0 commit comments