修复删除Path时如果为null时空指针bug

This commit is contained in:
Yurin
2025-04-07 17:03:29 +08:00
parent 590e07a595
commit b591f153b3
2 changed files with 9 additions and 1 deletions

View File

@@ -5,6 +5,7 @@ import static org.junit.jupiter.api.Assertions.*;
import org.junit.jupiter.api.Disabled;
import org.junit.jupiter.api.Test;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.nio.file.StandardCopyOption;
@@ -93,4 +94,11 @@ public class PathUtilTest {
public void moveTest2(){
PathUtil.move(Paths.get("D:\\project\\test1.txt"), Paths.get("D:\\project\\test2.txt"), false);
}
@Test
@Disabled
public void delNullDirTest() {
Path path = null;
assertTrue(PathUtil.del(path));
}
}