mirror of
https://github.com/BurntSushi/ripgrep.git
synced 2025-05-19 09:40:22 -07:00
tests: remove existing test directory
I'm surprised this wasn't caught until now, but if a test directory already exists, then it was reused. This can result in hard to debug problems with tests when, e.g., file names are changed and a recursive search is executed.
This commit is contained in:
parent
a18cf6ec39
commit
88f46d12f1
@ -76,6 +76,9 @@ impl Dir {
|
|||||||
.join(TEST_DIR)
|
.join(TEST_DIR)
|
||||||
.join(name)
|
.join(name)
|
||||||
.join(&format!("{}", id));
|
.join(&format!("{}", id));
|
||||||
|
if dir.exists() {
|
||||||
|
nice_err(&dir, fs::remove_dir_all(&dir));
|
||||||
|
}
|
||||||
nice_err(&dir, repeat(|| fs::create_dir_all(&dir)));
|
nice_err(&dir, repeat(|| fs::create_dir_all(&dir)));
|
||||||
Dir {
|
Dir {
|
||||||
root: root,
|
root: root,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user