Skip to content

Commit b6cd17f

Browse files
committed
Fix test bug (again)
1 parent a06caf6 commit b6cd17f

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

src/test/mod.rs

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -885,30 +885,28 @@ impl Drop for TempFile {
885885

886886
#[test]
887887
fn verify_check_works() {
888-
let file_name = "temp_check.rs";
889-
let _temp_file = make_temp_file(file_name);
888+
let temp_file = make_temp_file("temp_check.rs");
890889
assert_cli::Assert::command(&[
891890
"cargo",
892891
"run",
893892
"--bin=rustfmt",
894893
"--",
895894
"--write-mode=check",
896-
file_name,
895+
temp_file.path.to_str().unwrap(),
897896
]).succeeds()
898897
.unwrap();
899898
}
900899

901900
#[test]
902901
fn verify_diff_works() {
903-
let file_name = "temp_diff.rs";
904-
let _temp_file = make_temp_file(file_name);
902+
let temp_file = make_temp_file("temp_diff.rs");
905903
assert_cli::Assert::command(&[
906904
"cargo",
907905
"run",
908906
"--bin=rustfmt",
909907
"--",
910908
"--write-mode=diff",
911-
file_name,
909+
temp_file.path.to_str().unwrap(),
912910
]).succeeds()
913911
.unwrap();
914912
}

0 commit comments

Comments
 (0)