Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Don't allow .html files in tests/mir-opt/ #120018

Merged
merged 1 commit into from
Jan 16, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 6 additions & 5 deletions src/tools/miropt-test-tools/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -98,11 +98,12 @@ pub fn files_for_miropt_test(
from_file = format!("{}.{}.mir", test_name, first_pass);
to_file = Some(second_file);
} else {
let ext_re = regex::Regex::new(r#"(\.(mir|dot|html))$"#).unwrap();
let cap = ext_re
.captures_iter(test_name)
.next()
.expect("test_name has an invalid extension");
// Allow-list for file extensions that can be produced by MIR dumps.
// Other extensions can be added here, as needed by new dump flags.
let ext_re = regex::Regex::new(r#"(\.(mir|dot))$"#).unwrap();
let cap = ext_re.captures_iter(test_name).next().unwrap_or_else(|| {
panic!("in {testfile:?}:\nEMIT_MIR has an unrecognized extension: {test_name}")
});
let extension = cap.get(1).unwrap().as_str();

expected_file =
Expand Down
Loading