| ... | ... | @@ -1643,10 +1643,10 @@ test "hexToBytes" { |
| 1643 | 1643 | test "formatIntValue with comptime_int" { |
| 1644 | 1644 | const value: comptime_int = 123456789123456789; |
| 1645 | 1645 | |
| 1646 | | var buf = try std.Buffer.init(std.testing.allocator, ""); |
| 1646 | var buf = std.ArrayList(u8).init(std.testing.allocator); |
| 1647 | 1647 | defer buf.deinit(); |
| 1648 | | try formatIntValue(value, "", FormatOptions{}, &buf, @TypeOf(std.Buffer.append).ReturnType.ErrorSet, std.Buffer.append); |
| 1649 | | std.testing.expect(mem.eql(u8, buf.toSlice(), "123456789123456789")); |
| 1648 | try formatIntValue(value, "", FormatOptions{}, &buf, @TypeOf(std.ArrayList(u8).appendSlice).ReturnType.ErrorSet, std.ArrayList(u8).appendSlice); |
| 1649 | std.testing.expect(mem.eql(u8, buf.toSliceConst(), "123456789123456789")); |
| 1650 | 1650 | } |
| 1651 | 1651 | |
| 1652 | 1652 | test "formatType max_depth" { |
| ... | ... | @@ -1698,24 +1698,24 @@ test "formatType max_depth" { |
| 1698 | 1698 | inst.a = &inst; |
| 1699 | 1699 | inst.tu.ptr = &inst.tu; |
| 1700 | 1700 | |
| 1701 | | var buf0 = try std.Buffer.init(std.testing.allocator, ""); |
| 1701 | var buf0 = std.ArrayList(u8).init(std.testing.allocator); |
| 1702 | 1702 | defer buf0.deinit(); |
| 1703 | | try formatType(inst, "", FormatOptions{}, &buf0, @TypeOf(std.Buffer.append).ReturnType.ErrorSet, std.Buffer.append, 0); |
| 1703 | try formatType(inst, "", FormatOptions{}, &buf0, @TypeOf(std.ArrayList(u8).appendSlice).ReturnType.ErrorSet, std.ArrayList(u8).appendSlice, 0); |
| 1704 | 1704 | std.testing.expect(mem.eql(u8, buf0.toSlice(), "S{ ... }")); |
| 1705 | 1705 | |
| 1706 | | var buf1 = try std.Buffer.init(std.testing.allocator, ""); |
| 1706 | var buf1 = std.ArrayList(u8).init(std.testing.allocator); |
| 1707 | 1707 | defer buf1.deinit(); |
| 1708 | | try formatType(inst, "", FormatOptions{}, &buf1, @TypeOf(std.Buffer.append).ReturnType.ErrorSet, std.Buffer.append, 1); |
| 1708 | try formatType(inst, "", FormatOptions{}, &buf1, @TypeOf(std.ArrayList(u8).appendSlice).ReturnType.ErrorSet, std.ArrayList(u8).appendSlice, 1); |
| 1709 | 1709 | std.testing.expect(mem.eql(u8, buf1.toSlice(), "S{ .a = S{ ... }, .tu = TU{ ... }, .e = E.Two, .vec = (10.200,2.220) }")); |
| 1710 | 1710 | |
| 1711 | | var buf2 = try std.Buffer.init(std.testing.allocator, ""); |
| 1711 | var buf2 = std.ArrayList(u8).init(std.testing.allocator); |
| 1712 | 1712 | defer buf2.deinit(); |
| 1713 | | try formatType(inst, "", FormatOptions{}, &buf2, @TypeOf(std.Buffer.append).ReturnType.ErrorSet, std.Buffer.append, 2); |
| 1713 | try formatType(inst, "", FormatOptions{}, &buf2, @TypeOf(std.ArrayList(u8).appendSlice).ReturnType.ErrorSet, std.ArrayList(u8).appendSlice, 2); |
| 1714 | 1714 | 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) }")); |
| 1715 | 1715 | |
| 1716 | | var buf3 = try std.Buffer.init(std.testing.allocator, ""); |
| 1716 | var buf3 = std.ArrayList(u8).init(std.testing.allocator); |
| 1717 | 1717 | defer buf3.deinit(); |
| 1718 | | try formatType(inst, "", FormatOptions{}, &buf3, @TypeOf(std.Buffer.append).ReturnType.ErrorSet, std.Buffer.append, 3); |
| 1718 | try formatType(inst, "", FormatOptions{}, &buf3, @TypeOf(std.ArrayList(u8).appendSlice).ReturnType.ErrorSet, std.ArrayList(u8).appendSlice, 3); |
| 1719 | 1719 | 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) }")); |
| 1720 | 1720 | } |
| 1721 | 1721 | |