remove check_compile_error, fix cli tests

This commit is contained in:
Luke Boswell 2024-08-18 15:40:41 +10:00
parent e7a90f1ab5
commit cd955fdb7a
No known key found for this signature in database
GPG key ID: F6DB3C9DB47377B0
2 changed files with 116 additions and 132 deletions

View file

@ -62,6 +62,10 @@ impl Out {
self.assert_success_with_no_unexpected_errors(COMMON_STDERR.as_slice());
}
pub fn assert_nonzero_exit(&self) {
assert_eq!(self.status.success(), false);
}
/// Assert that the command succeeded and that there are no unexpected errors in the stderr.
/// This DOES NOT normalise the output, use assert_stdout_ends_with for that.
pub fn assert_success_with_no_unexpected_errors(&self, expected_errors: &[ExpectedString]) {
@ -79,8 +83,7 @@ impl Out {
let without_clrf = input.replace("\r\n", "\n");
// remove ANSI color codes
let ansi_regex = Regex::new(r"\x1b\[[0-9;]*[mGKH]").expect("Invalid ANSI regex pattern");
let without_ansi = ansi_regex.replace_all(without_clrf.as_str(), "");
let without_ansi = roc_reporting::report::strip_colors(without_clrf.as_str());
// replace timings with a placeholder
let regex = Regex::new(r" in (\d+) ms\.").expect("Invalid regex pattern");
@ -522,17 +525,3 @@ pub fn file_from_root(dir_name: &str, file_name: &str) -> PathBuf {
path
}
#[allow(dead_code)]
pub fn known_bad_file(file_name: &str) -> PathBuf {
let mut path = root_dir();
// Descend into cli/tests/known_bad/{file_name}
path.push("crates");
path.push("cli");
path.push("tests");
path.push("known_bad");
path.push(file_name);
path
}