@@ -1633,10 +1633,10 @@ test "hexToBytes" {
1633
1633
test "formatIntValue with comptime_int" {
1634
1634
const value : comptime_int = 123456789123456789 ;
1635
1635
1636
- var buf = try std .Buffer .init (std .testing .allocator , "" );
1636
+ var buf = std .ArrayList ( u8 ) .init (std .testing .allocator );
1637
1637
defer buf .deinit ();
1638
- try formatIntValue (value , "" , FormatOptions {}, & buf , @TypeOf (std .Buffer . append ).ReturnType .ErrorSet , std .Buffer . append );
1639
- std .testing .expect (mem .eql (u8 , buf .toSlice (), "123456789123456789" ));
1638
+ try formatIntValue (value , "" , FormatOptions {}, & buf , @TypeOf (std .ArrayList ( u8 ). appendSlice ).ReturnType .ErrorSet , std .ArrayList ( u8 ). appendSlice );
1639
+ std .testing .expect (mem .eql (u8 , buf .toSliceConst (), "123456789123456789" ));
1640
1640
}
1641
1641
1642
1642
test "formatType max_depth" {
@@ -1688,24 +1688,24 @@ test "formatType max_depth" {
1688
1688
inst .a = & inst ;
1689
1689
inst .tu .ptr = & inst .tu ;
1690
1690
1691
- var buf0 = try std .Buffer .init (std .testing .allocator , "" );
1691
+ var buf0 = std .ArrayList ( u8 ) .init (std .testing .allocator );
1692
1692
defer buf0 .deinit ();
1693
- try formatType (inst , "" , FormatOptions {}, & buf0 , @TypeOf (std .Buffer . append ).ReturnType .ErrorSet , std .Buffer . append , 0 );
1693
+ try formatType (inst , "" , FormatOptions {}, & buf0 , @TypeOf (std .ArrayList ( u8 ). appendSlice ).ReturnType .ErrorSet , std .ArrayList ( u8 ). appendSlice , 0 );
1694
1694
std .testing .expect (mem .eql (u8 , buf0 .toSlice (), "S{ ... }" ));
1695
1695
1696
- var buf1 = try std .Buffer .init (std .testing .allocator , "" );
1696
+ var buf1 = std .ArrayList ( u8 ) .init (std .testing .allocator );
1697
1697
defer buf1 .deinit ();
1698
- try formatType (inst , "" , FormatOptions {}, & buf1 , @TypeOf (std .Buffer . append ).ReturnType .ErrorSet , std .Buffer . append , 1 );
1698
+ try formatType (inst , "" , FormatOptions {}, & buf1 , @TypeOf (std .ArrayList ( u8 ). appendSlice ).ReturnType .ErrorSet , std .ArrayList ( u8 ). appendSlice , 1 );
1699
1699
std .testing .expect (mem .eql (u8 , buf1 .toSlice (), "S{ .a = S{ ... }, .tu = TU{ ... }, .e = E.Two, .vec = (10.200,2.220) }" ));
1700
1700
1701
- var buf2 = try std .Buffer .init (std .testing .allocator , "" );
1701
+ var buf2 = std .ArrayList ( u8 ) .init (std .testing .allocator );
1702
1702
defer buf2 .deinit ();
1703
- try formatType (inst , "" , FormatOptions {}, & buf2 , @TypeOf (std .Buffer . append ).ReturnType .ErrorSet , std .Buffer . append , 2 );
1703
+ try formatType (inst , "" , FormatOptions {}, & buf2 , @TypeOf (std .ArrayList ( u8 ). appendSlice ).ReturnType .ErrorSet , std .ArrayList ( u8 ). appendSlice , 2 );
1704
1704
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) }" ));
1705
1705
1706
- var buf3 = try std .Buffer .init (std .testing .allocator , "" );
1706
+ var buf3 = std .ArrayList ( u8 ) .init (std .testing .allocator );
1707
1707
defer buf3 .deinit ();
1708
- try formatType (inst , "" , FormatOptions {}, & buf3 , @TypeOf (std .Buffer . append ).ReturnType .ErrorSet , std .Buffer . append , 3 );
1708
+ try formatType (inst , "" , FormatOptions {}, & buf3 , @TypeOf (std .ArrayList ( u8 ). appendSlice ).ReturnType .ErrorSet , std .ArrayList ( u8 ). appendSlice , 3 );
1709
1709
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) }" ));
1710
1710
}
1711
1711
0 commit comments