mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-14 15:55:02 +00:00
A couple hacks to get deriving of records working.. but it's working?
This commit is contained in:
parent
801803d813
commit
63adb901b4
8 changed files with 156 additions and 104 deletions
|
@ -1797,3 +1797,40 @@ fn instantiate_annotated_as_recursive_alias_multiple_polymorphic_expr() {
|
|||
"#
|
||||
)
|
||||
}
|
||||
|
||||
#[mono_test]
|
||||
fn encode_derived_record_one_field_string() {
|
||||
indoc!(
|
||||
r#"
|
||||
app "test"
|
||||
imports [Encode.{ toEncoder }, Json]
|
||||
provides [main] to "./platform"
|
||||
|
||||
main =
|
||||
result = Str.fromUtf8 (Encode.toBytes {a: "foo"} 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() {
|
||||
indoc!(
|
||||
r#"
|
||||
app "test"
|
||||
imports [Encode.{ toEncoder }, Json]
|
||||
provides [main] to "./platform"
|
||||
|
||||
main =
|
||||
x : [A Str]
|
||||
x = A "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