mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-27 22:09:09 +00:00
Scaffold tests
This commit is contained in:
parent
bb0777c3c8
commit
0e63efdf09
2 changed files with 110 additions and 0 deletions
|
@ -6455,4 +6455,62 @@ mod solve_expr {
|
|||
"Str",
|
||||
)
|
||||
}
|
||||
|
||||
#[test]
|
||||
#[ignore]
|
||||
fn encode_record() {
|
||||
infer_queries(
|
||||
indoc!(
|
||||
r#"
|
||||
app "test"
|
||||
imports [ Encode.{ toEncoder } ]
|
||||
provides [ main ] to "./platform"
|
||||
|
||||
main = toEncoder { a: "" }
|
||||
# ^^^^^^^^^
|
||||
"#
|
||||
),
|
||||
&[],
|
||||
)
|
||||
}
|
||||
|
||||
#[test]
|
||||
#[ignore]
|
||||
fn encode_record_with_nested_able_var() {
|
||||
infer_queries(
|
||||
indoc!(
|
||||
r#"
|
||||
app "test"
|
||||
imports [ Encode.{ toEncoder, Encoding } ]
|
||||
provides [ main ] to "./platform"
|
||||
|
||||
main : a -> _ | a has Encoding
|
||||
main = \a -> toEncoder { a: a }
|
||||
# ^^^^^^^^^
|
||||
"#
|
||||
),
|
||||
&[],
|
||||
)
|
||||
}
|
||||
|
||||
#[test]
|
||||
#[ignore]
|
||||
fn encode_record_with_nested_custom_impl() {
|
||||
infer_queries(
|
||||
indoc!(
|
||||
r#"
|
||||
app "test"
|
||||
imports [ Encode.{ toEncoder, Encoding, custom } ]
|
||||
provides [ main ] to "./platform"
|
||||
|
||||
A := {}
|
||||
toEncoder = \@A _ -> custom \b, _ -> b
|
||||
|
||||
main = toEncoder { a: @A {} }
|
||||
# ^^^^^^^^^
|
||||
"#
|
||||
),
|
||||
&[],
|
||||
)
|
||||
}
|
||||
}
|
||||
|
|
|
@ -10053,4 +10053,56 @@ All branches in an `if` must have the same type!
|
|||
),
|
||||
)
|
||||
}
|
||||
|
||||
#[test]
|
||||
#[ignore]
|
||||
fn function_does_not_implement_encoding() {
|
||||
new_report_problem_as(
|
||||
"cycle_through_non_function",
|
||||
indoc!(
|
||||
r#"
|
||||
Encode.toEncoder (\x -> x)
|
||||
"#
|
||||
),
|
||||
indoc!(
|
||||
r#"
|
||||
"#
|
||||
),
|
||||
)
|
||||
}
|
||||
|
||||
#[test]
|
||||
#[ignore]
|
||||
fn unbound_type_in_record_does_not_implement_encoding() {
|
||||
new_report_problem_as(
|
||||
"cycle_through_non_function",
|
||||
indoc!(
|
||||
r#"
|
||||
\x -> Encode.toEncoder { x: x }
|
||||
"#
|
||||
),
|
||||
indoc!(
|
||||
r#"
|
||||
"#
|
||||
),
|
||||
)
|
||||
}
|
||||
|
||||
#[test]
|
||||
#[ignore]
|
||||
fn nested_opaque_does_not_implement_encoding() {
|
||||
new_report_problem_as(
|
||||
"cycle_through_non_function",
|
||||
indoc!(
|
||||
r#"
|
||||
A := {}
|
||||
Encode.toEncoder { x: @A {} }
|
||||
"#
|
||||
),
|
||||
indoc!(
|
||||
r#"
|
||||
"#
|
||||
),
|
||||
)
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue