Skip to content

Commit

Permalink
Merge pull request #500 from moonbitlang/test_in_main_pkg
Browse files Browse the repository at this point in the history
internal: warn about test block in main pkg
  • Loading branch information
Young-Flash authored Dec 2, 2024
2 parents b242ba1 + aedeace commit b7ae8ff
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
2 changes: 1 addition & 1 deletion crates/moon/tests/test_cases/fuzzy_matching/moon.test
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@

$ moon test -p asdf --sort-input --no-parallelize

Warning: no test entry found
Warning: no test entry found(test block in main package is not support for now)

$ moon test -p y -f asdf --sort-input --no-parallelize
Total tests: 0, passed: 0, failed: 0.
Expand Down
2 changes: 1 addition & 1 deletion crates/moon/tests/test_cases/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3960,7 +3960,7 @@ fn test_moon_test_no_entry_warning() {
check(
std::str::from_utf8(&out).unwrap(),
expect![[r#"
Warning: no test entry found
Warning: no test entry found(test block in main package is not support for now)
"#]],
);
}
Expand Down
5 changes: 4 additions & 1 deletion crates/moonbuild/src/gen/gen_runtest.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1106,7 +1106,10 @@ pub fn gen_n2_runtest_state(
}

if default.is_empty() {
eprintln!("{}: no test entry found", "Warning".yellow().bold());
eprintln!(
"{}: no test entry found(test block in main package is not support for now)",
"Warning".yellow().bold()
);
std::process::exit(0);
}

Expand Down

0 comments on commit b7ae8ff

Please sign in to comment.