| ... | @@ -73,6 +73,15 @@ test "stringify many-item sentinel-terminated string" { | ... | @@ -73,6 +73,15 @@ test "stringify many-item sentinel-terminated string" { |
| 73 | try teststringify("\"with unicode\\u0001\"", @as([*:0]const u8, "with unicode\u{1}"), StringifyOptions{ .string = .{ .String = .{ .escape_unicode = true } } }); | 73 | try teststringify("\"with unicode\\u0001\"", @as([*:0]const u8, "with unicode\u{1}"), StringifyOptions{ .string = .{ .String = .{ .escape_unicode = true } } }); |
| 74 | } | 74 | } |
| 75 | | 75 | |
| | 76 | test "stringify enums" { |
| | 77 | const E = enum { |
| | 78 | foo, |
| | 79 | bar, |
| | 80 | }; |
| | 81 | try teststringify("\"foo\"", E.foo, .{}); |
| | 82 | try teststringify("\"bar\"", E.bar, .{}); |
| | 83 | } |
| | 84 | |
| 76 | test "stringify tagged unions" { | 85 | test "stringify tagged unions" { |
| 77 | const T = union(enum) { | 86 | const T = union(enum) { |
| 78 | nothing, | 87 | nothing, |