mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-30 23:31:12 +00:00
Mono and can tests for Dict.len Dict.empty
This commit is contained in:
parent
ec7d8e0dc9
commit
171e0358f3
3 changed files with 45 additions and 0 deletions
|
@ -967,6 +967,21 @@ mod test_can {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn dict() {
|
||||||
|
let src = indoc!(
|
||||||
|
r#"
|
||||||
|
x = Dict.empty
|
||||||
|
|
||||||
|
Dict.len x
|
||||||
|
"#
|
||||||
|
);
|
||||||
|
let arena = Bump::new();
|
||||||
|
let CanExprOut { problems, .. } = can_expr_with(&arena, test_home(), src);
|
||||||
|
|
||||||
|
assert_eq!(problems, Vec::new());
|
||||||
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn unused_def_regression() {
|
fn unused_def_regression() {
|
||||||
let src = indoc!(
|
let src = indoc!(
|
||||||
|
|
|
@ -1264,6 +1264,7 @@ where
|
||||||
.stack_size(EXPANDED_STACK_SIZE)
|
.stack_size(EXPANDED_STACK_SIZE)
|
||||||
.spawn(move |_| {
|
.spawn(move |_| {
|
||||||
// Keep listening until we receive a Shutdown msg
|
// Keep listening until we receive a Shutdown msg
|
||||||
|
|
||||||
for msg in worker_msg_rx.iter() {
|
for msg in worker_msg_rx.iter() {
|
||||||
match msg {
|
match msg {
|
||||||
WorkerMsg::Shutdown => {
|
WorkerMsg::Shutdown => {
|
||||||
|
|
|
@ -55,6 +55,7 @@ mod test_mono {
|
||||||
}
|
}
|
||||||
|
|
||||||
let exposed_types = MutMap::default();
|
let exposed_types = MutMap::default();
|
||||||
|
|
||||||
let loaded = roc_load::file::load_and_monomorphize_from_str(
|
let loaded = roc_load::file::load_and_monomorphize_from_str(
|
||||||
arena,
|
arena,
|
||||||
filename,
|
filename,
|
||||||
|
@ -633,6 +634,34 @@ mod test_mono {
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn dict() {
|
||||||
|
compiles_to_ir(
|
||||||
|
r#"
|
||||||
|
Dict.len Dict.empty
|
||||||
|
"#,
|
||||||
|
indoc!(
|
||||||
|
r#"
|
||||||
|
procedure List.5 (#Attr.2, #Attr.3):
|
||||||
|
let Test.7 = lowlevel ListAppend #Attr.2 #Attr.3;
|
||||||
|
ret Test.7;
|
||||||
|
|
||||||
|
procedure Test.1 (Test.2):
|
||||||
|
let Test.6 = 42i64;
|
||||||
|
let Test.5 = CallByName List.5 Test.2 Test.6;
|
||||||
|
ret Test.5;
|
||||||
|
|
||||||
|
procedure Test.0 ():
|
||||||
|
let Test.8 = 1i64;
|
||||||
|
let Test.9 = 2i64;
|
||||||
|
let Test.4 = Array [Test.8, Test.9];
|
||||||
|
let Test.3 = CallByName Test.1 Test.4;
|
||||||
|
ret Test.3;
|
||||||
|
"#
|
||||||
|
),
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn list_append_closure() {
|
fn list_append_closure() {
|
||||||
compiles_to_ir(
|
compiles_to_ir(
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue