mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-26 21:39:07 +00:00
Gen derived tag encoders with multiple payloads
This commit is contained in:
parent
ad5d6a4f84
commit
2ca86c84dc
2 changed files with 338 additions and 0 deletions
|
@ -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>"
|
||||
"#
|
||||
)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue