File tree Expand file tree Collapse file tree 1 file changed +10
-2
lines changed Expand file tree Collapse file tree 1 file changed +10
-2
lines changed Original file line number Diff line number Diff line change @@ -1123,8 +1123,8 @@ pub fn printValue(
1123
1123
else = > invalidFmtError (fmt , value ),
1124
1124
},
1125
1125
't' = > switch (@typeInfo (T )) {
1126
- .error_set = > return w .writeAll (@errorName (value )),
1127
- .@"enum" , .@"union" = > return w .writeAll (@tagName (value )),
1126
+ .error_set = > return w .alignBufferOptions (@errorName (value ), options ),
1127
+ .@"enum" , .@"union" = > return w .alignBufferOptions (@tagName (value ), options ),
1128
1128
else = > invalidFmtError (fmt , value ),
1129
1129
},
1130
1130
else = > {},
@@ -2134,6 +2134,14 @@ test "bytes.hex" {
2134
2134
try testing .expectFmt ("lowercase: 000ebabe\n " , "lowercase: {x}\n " , .{bytes_with_zeros });
2135
2135
}
2136
2136
2137
+ test "padding" {
2138
+ const foo : enum { foo } = .foo ;
2139
+ try testing .expectFmt ("tag: |foo |\n " , "tag: |{t:<4}|\n " , .{foo });
2140
+
2141
+ const bar : error {bar } = error .bar ;
2142
+ try testing .expectFmt ("error: |bar |\n " , "error: |{t:<4}|\n " , .{bar });
2143
+ }
2144
+
2137
2145
test fixed {
2138
2146
{
2139
2147
var buf : [255 ]u8 = undefined ;
You can’t perform that action at this time.
0 commit comments