mirror of
https://github.com/roc-lang/roc.git
synced 2025-10-02 08:11:12 +00:00
WIP upgrade cli tests transitive-deps
This commit is contained in:
parent
804cb6e067
commit
c8522c246f
6 changed files with 90 additions and 72 deletions
|
@ -1233,6 +1233,84 @@ mod cli_run {
|
||||||
out.assert_stdout_ends_with(expected_ending);
|
out.assert_stdout_ends_with(expected_ending);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
#[cfg_attr(windows, ignore)]
|
||||||
|
fn run_transitive_deps_app() {
|
||||||
|
build_platform_host();
|
||||||
|
|
||||||
|
let file_path = from_root(
|
||||||
|
"crates/cli/tests/fixtures/transitive-deps",
|
||||||
|
"direct-one.roc",
|
||||||
|
);
|
||||||
|
|
||||||
|
let expected_ending = "[One imports Two: From two]\n";
|
||||||
|
let runner = cli_utils::helpers::Run::new_roc()
|
||||||
|
.arg(CMD_RUN)
|
||||||
|
.arg(file_path.as_path());
|
||||||
|
|
||||||
|
if ALLOW_VALGRIND {
|
||||||
|
let out = runner.run_with_valgrind();
|
||||||
|
out.assert_clean_success();
|
||||||
|
out.assert_stdout_ends_with(expected_ending);
|
||||||
|
} else {
|
||||||
|
let out = runner.run();
|
||||||
|
out.assert_clean_success();
|
||||||
|
out.assert_stdout_ends_with(expected_ending);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
#[cfg_attr(windows, ignore)]
|
||||||
|
fn run_transitive_and_direct_dep_app() {
|
||||||
|
build_platform_host();
|
||||||
|
|
||||||
|
let file_path = from_root(
|
||||||
|
"crates/cli/tests/fixtures/transitive-deps",
|
||||||
|
"direct-one-and-two.roc",
|
||||||
|
);
|
||||||
|
|
||||||
|
let expected_ending = "[One imports Two: From two] | From two\n";
|
||||||
|
let runner = cli_utils::helpers::Run::new_roc()
|
||||||
|
.arg(CMD_RUN)
|
||||||
|
.arg(file_path.as_path());
|
||||||
|
|
||||||
|
if ALLOW_VALGRIND {
|
||||||
|
let out = runner.run_with_valgrind();
|
||||||
|
out.assert_clean_success();
|
||||||
|
out.assert_stdout_ends_with(expected_ending);
|
||||||
|
} else {
|
||||||
|
let out = runner.run();
|
||||||
|
out.assert_clean_success();
|
||||||
|
out.assert_stdout_ends_with(expected_ending);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
#[cfg_attr(windows, ignore)]
|
||||||
|
fn run_double_transitive_dep_app() {
|
||||||
|
build_platform_host();
|
||||||
|
|
||||||
|
let file_path = from_root(
|
||||||
|
"crates/cli/tests/fixtures/transitive-deps",
|
||||||
|
"direct-zero.roc",
|
||||||
|
);
|
||||||
|
|
||||||
|
let expected_ending = "[Zero imports One: [One imports Two: From two]]\n";
|
||||||
|
let runner = cli_utils::helpers::Run::new_roc()
|
||||||
|
.arg(CMD_RUN)
|
||||||
|
.arg(file_path.as_path());
|
||||||
|
|
||||||
|
if ALLOW_VALGRIND {
|
||||||
|
let out = runner.run_with_valgrind();
|
||||||
|
out.assert_clean_success();
|
||||||
|
out.assert_stdout_ends_with(expected_ending);
|
||||||
|
} else {
|
||||||
|
let out = runner.run();
|
||||||
|
out.assert_clean_success();
|
||||||
|
out.assert_stdout_ends_with(expected_ending);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO not sure if this cfg should still be here: #[cfg(not(debug_assertions))]
|
// TODO not sure if this cfg should still be here: #[cfg(not(debug_assertions))]
|
||||||
|
@ -1503,66 +1581,6 @@ mod cli_run {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
|
||||||
#[serial(multi_dep_thunk)]
|
|
||||||
#[cfg_attr(windows, ignore)]
|
|
||||||
fn run_transitive_deps_app() {
|
|
||||||
let file_path = from_root(
|
|
||||||
"crates/cli/tests/fixtures/transitive-deps",
|
|
||||||
"direct-one.roc",
|
|
||||||
);
|
|
||||||
|
|
||||||
test_roc_app(
|
|
||||||
file_path.as_path(),
|
|
||||||
vec![],
|
|
||||||
&[],
|
|
||||||
vec![],
|
|
||||||
"[One imports Two: From two]\n",
|
|
||||||
UseValgrind::Yes,
|
|
||||||
TestCliCommands::Run,
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
#[test]
|
|
||||||
#[serial(multi_dep_thunk)]
|
|
||||||
#[cfg_attr(windows, ignore)]
|
|
||||||
fn run_transitive_and_direct_dep_app() {
|
|
||||||
let file_path = from_root(
|
|
||||||
"crates/cli/tests/fixtures/transitive-deps",
|
|
||||||
"direct-one-and-two.roc",
|
|
||||||
);
|
|
||||||
|
|
||||||
test_roc_app(
|
|
||||||
file_path.as_path(),
|
|
||||||
vec![],
|
|
||||||
&[],
|
|
||||||
vec![],
|
|
||||||
"[One imports Two: From two] | From two\n",
|
|
||||||
UseValgrind::Yes,
|
|
||||||
TestCliCommands::Run,
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
#[test]
|
|
||||||
#[serial(multi_dep_thunk)]
|
|
||||||
#[cfg_attr(windows, ignore)]
|
|
||||||
fn run_double_transitive_dep_app() {
|
|
||||||
let file_path = from_root(
|
|
||||||
"crates/cli/tests/fixtures/transitive-deps",
|
|
||||||
"direct-zero.roc",
|
|
||||||
);
|
|
||||||
|
|
||||||
test_roc_app(
|
|
||||||
file_path.as_path(),
|
|
||||||
vec![],
|
|
||||||
&[],
|
|
||||||
vec![],
|
|
||||||
"[Zero imports One: [One imports Two: From two]]\n",
|
|
||||||
UseValgrind::Yes,
|
|
||||||
TestCliCommands::Run,
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn known_type_error() {
|
fn known_type_error() {
|
||||||
check_compile_error(
|
check_compile_error(
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
app [main] {
|
app [main] {
|
||||||
pf: platform "../packages/platform/main.roc",
|
pf: platform "../../test-platform-simple-zig/main.roc",
|
||||||
one: "one/main.roc",
|
one: "one/main.roc",
|
||||||
two: "two/main.roc",
|
two: "two/main.roc",
|
||||||
}
|
}
|
||||||
|
|
||||||
import one.One
|
import one.One
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
app [main] {
|
app [main] {
|
||||||
pf: platform "../packages/platform/main.roc",
|
pf: platform "../../test-platform-simple-zig/main.roc",
|
||||||
one: "one/main.roc",
|
one: "one/main.roc",
|
||||||
}
|
}
|
||||||
|
|
||||||
import one.One
|
import one.One
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
app [main] {
|
app [main] {
|
||||||
pf: platform "../packages/platform/main.roc",
|
pf: platform "../../test-platform-simple-zig/main.roc",
|
||||||
zero: "zero/main.roc",
|
zero: "zero/main.roc",
|
||||||
}
|
}
|
||||||
|
|
||||||
import zero.Zero
|
import zero.Zero
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
module [example]
|
module [example]
|
||||||
|
|
||||||
import two.Two
|
import two.Two
|
||||||
|
|
||||||
|
|
|
@ -1,3 +1,3 @@
|
||||||
package [Zero] {
|
package [Zero] {
|
||||||
one: "../one/main.roc"
|
one: "../one/main.roc",
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue