Skip to content

Commit

Permalink
Weird test fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Rongmario committed Apr 27, 2024
1 parent 25e60a1 commit 537b63d
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/test/java/zone/rong/bansoukou/test/ListFilesTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

import java.io.File;
import java.io.IOException;
import java.nio.file.FileAlreadyExistsException;
import java.nio.file.Files;
import java.nio.file.Path;
import java.util.ArrayList;
Expand All @@ -26,7 +27,12 @@ public void test(@TempDir Path directory) throws IOException {
}
Path resolved = directory.resolve(i + "bansoukou.jar");
files.add(resolved);
Files.createFile(resolved);
try {
Files.createFile(resolved);
} catch (FileAlreadyExistsException e) {
System.out.println(i + "bansoukou.jar resulted in FileAlreadyExistsException.");
e.printStackTrace();
}
}
Assertions.assertFalse(files.isEmpty());
File directoryAsFile = directory.toFile();
Expand Down

0 comments on commit 537b63d

Please sign in to comment.