Skip to content

Commit

Permalink
Auto merge of rust-lang#11905 - pgerber:tests, r=dswij
Browse files Browse the repository at this point in the history
Tolerate hidden, binary files in tests/

Avoid scanning temporary files created by editors like this one created by Vim:

---- old_test_headers stdout ----
thread 'old_test_headers' panicked at tests/headers.rs:19:74: tests/ui/.regex.rs.swp: stream did not contain valid UTF-8 note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

changelog: none
  • Loading branch information
bors committed Dec 2, 2023
2 parents 31aa0b2 + 1e67f6c commit da27c97
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion tests/headers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,12 @@ fn old_test_headers() {

for entry in WalkDir::new("tests") {
let entry = entry.unwrap();
if !entry.file_type().is_file() {
let is_hidden_file = entry
.file_name()
.to_str()
.expect("non-UTF-8 file name")
.starts_with('.');
if is_hidden_file || !entry.file_type().is_file() {
continue;
}

Expand Down

0 comments on commit da27c97

Please sign in to comment.