Add ignored empty record decoding test

This commit is contained in:
Ayaz Hafiz 2022-08-15 11:05:59 -05:00
parent 21c3d0cafa
commit bed9b57b58
No known key found for this signature in database
GPG Key ID: 0E2A37416A25EF58

View File

@ -990,3 +990,23 @@ fn decode_record_two_fields_string_and_int() {
RocStr
)
}
#[test]
#[cfg(any(feature = "gen-llvm", feature = "gen-wasm"))]
#[ignore = "json parsing impl must be fixed first"]
fn decode_empty_record() {
assert_evals_to!(
indoc!(
r#"
app "test" imports [Encode, Decode, Json] provides [main] to "./platform"
main =
when Str.toUtf8 "{}" |> Decode.fromBytes Json.fromUtf8 is
Ok {} -> "empty"
_ -> "something went wrong"
"#
),
RocStr::from("empty"),
RocStr
)
}