mirror of
https://github.com/roc-lang/roc.git
synced 2025-08-31 09:07:21 +00:00
Migrate couple more tests
This commit is contained in:
parent
8148f5d570
commit
2dcafffb46
3 changed files with 36 additions and 62 deletions
|
@ -254,41 +254,6 @@ mod solve_expr {
|
|||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn choose_correct_recursion_var_under_record() {
|
||||
infer_queries!(
|
||||
indoc!(
|
||||
r#"
|
||||
Parser : [
|
||||
Specialize Parser,
|
||||
Record (List {parser: Parser}),
|
||||
]
|
||||
|
||||
printCombinatorParser : Parser -> Str
|
||||
printCombinatorParser = \parser ->
|
||||
when parser is
|
||||
# ^^^^^^
|
||||
Specialize p ->
|
||||
printed = printCombinatorParser p
|
||||
if Bool.false then printed else "foo"
|
||||
Record fields ->
|
||||
fields
|
||||
|> List.map \f ->
|
||||
printed = printCombinatorParser f.parser
|
||||
if Bool.false then printed else "foo"
|
||||
|> List.first
|
||||
|> Result.withDefault ("foo")
|
||||
|
||||
printCombinatorParser (Record [])
|
||||
"#
|
||||
),
|
||||
@r###"
|
||||
parser : [Record (List { parser : a }), Specialize a] as a
|
||||
"###
|
||||
print_only_under_alias: true
|
||||
);
|
||||
}
|
||||
|
||||
// LIST
|
||||
|
||||
#[test]
|
||||
|
@ -6007,33 +5972,6 @@ mod solve_expr {
|
|||
)
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn intermediate_branch_types() {
|
||||
infer_queries!(
|
||||
indoc!(
|
||||
r#"
|
||||
app "test" provides [foo] to "./platform"
|
||||
|
||||
foo : [True, False] -> Str
|
||||
foo = \ob ->
|
||||
# ^^
|
||||
when ob is
|
||||
# ^^
|
||||
True -> "A"
|
||||
# ^^^^
|
||||
False -> "B"
|
||||
# ^^^^^
|
||||
"#
|
||||
),
|
||||
@r###"
|
||||
ob : [False, True]
|
||||
ob : [False, True]
|
||||
True : [False, True]
|
||||
False : [False, True]
|
||||
"###
|
||||
)
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn nested_open_tag_union() {
|
||||
infer_eq_without_problem(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue