mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-26 13:29:12 +00:00
Use Derived_synth for synthesizing implementations, and Derived_gen for codegen
This commit is contained in:
parent
7c2e806a02
commit
df9bcb1a0c
16 changed files with 1543 additions and 628 deletions
|
@ -1815,6 +1815,40 @@ fn encode_derived_record_one_field_string() {
|
|||
)
|
||||
}
|
||||
|
||||
#[mono_test]
|
||||
fn encode_derived_record_two_field_strings() {
|
||||
indoc!(
|
||||
r#"
|
||||
app "test"
|
||||
imports [Encode.{ toEncoder }, Json]
|
||||
provides [main] to "./platform"
|
||||
|
||||
main =
|
||||
result = Str.fromUtf8 (Encode.toBytes {a: "foo", b: "bar"} Json.format)
|
||||
when result is
|
||||
Ok s -> s
|
||||
_ -> "<bad>"
|
||||
"#
|
||||
)
|
||||
}
|
||||
|
||||
#[mono_test]
|
||||
fn encode_derived_nested_record_string() {
|
||||
indoc!(
|
||||
r#"
|
||||
app "test"
|
||||
imports [Encode.{ toEncoder }, Json]
|
||||
provides [main] to "./platform"
|
||||
|
||||
main =
|
||||
result = Str.fromUtf8 (Encode.toBytes {a: {b: "bar"}} Json.format)
|
||||
when result is
|
||||
Ok s -> s
|
||||
_ -> "<bad>"
|
||||
"#
|
||||
)
|
||||
}
|
||||
|
||||
#[mono_test]
|
||||
#[ignore = "TODO make this work (one ULS var is missing)"]
|
||||
fn encode_derived_tag_one_field_string() {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue