diff options
| author | Peter Gerber <peter@arbitrary.ch> | 2023-12-02 13:25:21 +0000 |
|---|---|---|
| committer | Peter Gerber <peter@arbitrary.ch> | 2023-12-02 13:32:21 +0000 |
| commit | 1e67f6c0fbb221a42cf4ecc829334f5db795e798 (patch) | |
| tree | 0e283ee8b51faa188b00f70afa070c105bde5075 | |
| parent | ee8376075d8fcfa0bacc316e0417981cd458044c (diff) | |
| download | rust-1e67f6c0fbb221a42cf4ecc829334f5db795e798.tar.gz rust-1e67f6c0fbb221a42cf4ecc829334f5db795e798.zip | |
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
| -rw-r--r-- | tests/headers.rs | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/tests/headers.rs b/tests/headers.rs index 7eec9a9cdd2..d1f986ef526 100644 --- a/tests/headers.rs +++ b/tests/headers.rs @@ -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; } |
