put closure tests into one file

This commit is contained in:
Folkert 2021-02-19 21:29:33 +01:00
parent 903c0d8dec
commit ff20ab76ce
6 changed files with 8 additions and 104 deletions

View file

@ -241,47 +241,11 @@ mod cli_run {
}
#[test]
#[serial(closure1)]
fn closure1() {
#[serial(closure)]
fn closure() {
check_output(
&example_file("benchmarks", "Closure1.roc"),
"closure1",
&[],
"",
true,
);
}
#[test]
#[serial(closure2)]
fn closure2() {
check_output(
&example_file("benchmarks", "Closure2.roc"),
"closure2",
&[],
"",
true,
);
}
#[test]
#[serial(closure3)]
fn closure3() {
check_output(
&example_file("benchmarks", "Closure3.roc"),
"closure3",
&[],
"",
true,
);
}
#[test]
#[serial(closure4)]
fn closure4() {
check_output(
&example_file("benchmarks", "Closure4.roc"),
"closure4",
&example_file("benchmarks", "Closure.roc"),
"closure",
&[],
"",
true,

View file

@ -6514,8 +6514,10 @@ fn from_can_pattern_help<'a>(
debug_assert_eq!(
arguments.len(),
argument_layouts[1..].len(),
"{:?}",
tag_name
"The {:?} tag got {} arguments, but its layout expects {}!",
tag_name,
arguments.len(),
argument_layouts[1..].len(),
);
let it = argument_layouts[1..].iter();

View file

@ -1,15 +0,0 @@
app "closure1"
packages { base: "platform" }
imports [base.Task]
provides [ main ] to base
# see https://github.com/rtfeldman/roc/issues/985
main : Task.Task {} []
main =
Task.succeed (foo toUnitBorrowed "a long string such that it's malloced")
|> Task.map (\_ -> {})
toUnitBorrowed = \x -> Str.countGraphemes x
foo = \f, x -> f x

View file

@ -1,17 +0,0 @@
app "closure2"
packages { base: "platform" }
imports [base.Task]
provides [ main ] to base
# see https://github.com/rtfeldman/roc/issues/985
main : Task.Task {} []
main =
x : Str
x = "a long string such that it's malloced"
Task.succeed {}
|> Task.map (\_ -> x)
|> Task.map toUnit
toUnit = (\_ -> {})

View file

@ -1,14 +0,0 @@
app "closure3"
packages { base: "platform" }
imports [base.Task]
provides [ main ] to base
# see https://github.com/rtfeldman/roc/issues/985
main : Task.Task {} []
main =
x : Str
x = "a long string such that it's malloced"
Task.succeed {}
|> Task.after (\_ -> Task.succeed x |> Task.map (\_ -> {}))

View file

@ -1,16 +0,0 @@
app "closure4"
packages { base: "platform" }
imports [base.Task]
provides [ main ] to base
# see https://github.com/rtfeldman/roc/issues/985
main : Task.Task {} []
main =
x : Str
x = "a long string such that it's malloced"
Task.succeed {}
|> Task.after (\_ -> Task.succeed x)
|> Task.map (\_ -> {})