| ... | @@ -2238,6 +2238,14 @@ test "parse into struct with no fields" { | ... | @@ -2238,6 +2238,14 @@ test "parse into struct with no fields" { |
| 2238 | try testing.expectEqual(T{}, try parse(T, &ts, ParseOptions{})); | 2238 | try testing.expectEqual(T{}, try parse(T, &ts, ParseOptions{})); |
| 2239 | } | 2239 | } |
| 2240 | | 2240 | |
| | 2241 | const test_const_value: usize = 123; |
| | 2242 | |
| | 2243 | test "parse into struct with default const pointer field" { |
| | 2244 | const T = struct { a: *const usize = &test_const_value }; |
| | 2245 | var ts = TokenStream.init("{}"); |
| | 2246 | try testing.expectEqual(T{}, try parse(T, &ts, .{})); |
| | 2247 | } |
| | 2248 | |
| 2241 | test "parse into struct where destination and source lengths mismatch" { | 2249 | test "parse into struct where destination and source lengths mismatch" { |
| 2242 | const T = struct { a: [2]u8 }; | 2250 | const T = struct { a: [2]u8 }; |
| 2243 | var ts = TokenStream.init("{\"a\": \"bbb\"}"); | 2251 | var ts = TokenStream.init("{\"a\": \"bbb\"}"); |