| ... | @@ -496,6 +496,7 @@ pub fn formatType( | ... | @@ -496,6 +496,7 @@ pub fn formatType( |
| 496 | const buffer = [_]u8{'.'} ++ @tagName(value); | 496 | const buffer = [_]u8{'.'} ++ @tagName(value); |
| 497 | return formatType(buffer, fmt, options, writer, max_depth); | 497 | return formatType(buffer, fmt, options, writer, max_depth); |
| 498 | }, | 498 | }, |
| | 499 | .Null => return formatBuf("null", options, writer), |
| 499 | else => @compileError("Unable to format type '" ++ @typeName(T) ++ "'"), | 500 | else => @compileError("Unable to format type '" ++ @typeName(T) ++ "'"), |
| 500 | } | 501 | } |
| 501 | } | 502 | } |
| ... | @@ -1908,3 +1909,9 @@ test "sci float padding" { | ... | @@ -1908,3 +1909,9 @@ test "sci float padding" { |
| 1908 | try testFmt("center-pad: *3.141e+00*\n", "center-pad: {e:*^11.3}\n", .{number}); | 1909 | try testFmt("center-pad: *3.141e+00*\n", "center-pad: {e:*^11.3}\n", .{number}); |
| 1909 | try testFmt("right-pad: 3.141e+00**\n", "right-pad: {e:*<11.3}\n", .{number}); | 1910 | try testFmt("right-pad: 3.141e+00**\n", "right-pad: {e:*<11.3}\n", .{number}); |
| 1910 | } | 1911 | } |
| | 1912 | |
| | 1913 | test "null" { |
| | 1914 | const inst = null; |
| | 1915 | try testFmt("null", "{}", .{inst}); |
| | 1916 | } |
| | 1917 | |