Gen derived tag encoders with multiple payloads

This commit is contained in:
Ayaz Hafiz 2022-07-12 16:48:37 -04:00
parent ad5d6a4f84
commit 2ca86c84dc
No known key found for this signature in database
GPG key ID: 0E2A37416A25EF58
2 changed files with 338 additions and 0 deletions

View file

@ -1867,3 +1867,22 @@ fn encode_derived_tag_one_field_string() {
"#
)
}
#[mono_test]
fn encode_derived_tag_two_payloads_string() {
indoc!(
r#"
app "test"
imports [Encode.{ toEncoder }, Json]
provides [main] to "./platform"
main =
x : [A Str Str]
x = A "foo" "foo"
result = Str.fromUtf8 (Encode.toBytes x Json.format)
when result is
Ok s -> s
_ -> "<bad>"
"#
)
}