mirror of
https://github.com/roc-lang/roc.git
synced 2025-12-15 21:23:57 +00:00
parent
b7e9b07acb
commit
dfd0fdc990
2 changed files with 40 additions and 0 deletions
|
|
@ -1153,6 +1153,10 @@ fn bool_to_ast<'a, M: ReplAppMemory>(
|
|||
}
|
||||
}
|
||||
}
|
||||
Alias(Symbol::BOOL_BOOL, _, _, _) => Expr::Var {
|
||||
module_name: "Bool",
|
||||
ident: if value { "true" } else { "false" },
|
||||
},
|
||||
Alias(_, _, var, _) => {
|
||||
let content = env.subs.get_content_without_compacting(*var);
|
||||
|
||||
|
|
|
|||
|
|
@ -1239,3 +1239,39 @@ fn record_of_poly_function_and_string() {
|
|||
r#"{ a: <function>, b: "b" } : { a : * -> Str, b : Str }"#,
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn expr_produces_bool() {
|
||||
expect_success(
|
||||
indoc!(
|
||||
r#"
|
||||
1 == 1
|
||||
"#
|
||||
),
|
||||
r#"Bool.true : Bool"#,
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn bool_true() {
|
||||
expect_success(
|
||||
indoc!(
|
||||
r#"
|
||||
Bool.true
|
||||
"#
|
||||
),
|
||||
r#"Bool.true : Bool"#,
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn bool_false() {
|
||||
expect_success(
|
||||
indoc!(
|
||||
r#"
|
||||
Bool.fasle
|
||||
"#
|
||||
),
|
||||
r#"Bool.false : Bool"#,
|
||||
);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue