Fix --bless for mir-opt 32/64 bit file

This commit is contained in:
Nixon Enraght-Moony 2020-09-17 22:25:33 +01:00
parent 3c7593e69f
commit 735776d115
1 changed files with 4 additions and 3 deletions

View File

@ -3156,12 +3156,12 @@ impl<'test> TestCx<'test> {
if self.config.bless { if self.config.bless {
for e in for e in
glob(&format!("{}/{}.*.mir{}", test_dir.display(), test_crate, bit_width)).unwrap() glob(&format!("{}/{}.*{}.mir", test_dir.display(), test_crate, bit_width)).unwrap()
{ {
std::fs::remove_file(e.unwrap()).unwrap(); std::fs::remove_file(e.unwrap()).unwrap();
} }
for e in for e in
glob(&format!("{}/{}.*.diff{}", test_dir.display(), test_crate, bit_width)).unwrap() glob(&format!("{}/{}.*{}.diff", test_dir.display(), test_crate, bit_width)).unwrap()
{ {
std::fs::remove_file(e.unwrap()).unwrap(); std::fs::remove_file(e.unwrap()).unwrap();
} }
@ -3199,7 +3199,8 @@ impl<'test> TestCx<'test> {
from_file = format!("{}.{}.mir", test_name, first_pass); from_file = format!("{}.{}.mir", test_name, first_pass);
to_file = Some(second_file); to_file = Some(second_file);
} else { } else {
expected_file = format!("{}{}.mir", test_name.trim_end_matches(".mir"), bit_width); expected_file =
format!("{}{}.mir", test_name.trim_end_matches(".mir"), bit_width);
from_file = test_name.to_string(); from_file = test_name.to_string();
assert!( assert!(
test_names.next().is_none(), test_names.next().is_none(),