mirror of
https://github.com/TeamNewPipe/NewPipe
synced 2024-12-23 16:40:32 +00:00
Add more tests for FilePathUtils.isValidDirectoryPath for better coverage
This commit is contained in:
parent
92ab9cae27
commit
067528211f
@ -12,6 +12,12 @@ import static org.junit.Assert.assertTrue;
|
|||||||
public class FilePathHelperTest {
|
public class FilePathHelperTest {
|
||||||
@Test
|
@Test
|
||||||
public void testIsValidDirectoryPath() throws IOException {
|
public void testIsValidDirectoryPath() throws IOException {
|
||||||
|
// empty path is not valid
|
||||||
|
assertFalse(FilePathUtils.isValidDirectoryPath(""));
|
||||||
|
|
||||||
|
// null path is not valid
|
||||||
|
assertFalse(FilePathUtils.isValidDirectoryPath(null));
|
||||||
|
|
||||||
// path that exists
|
// path that exists
|
||||||
final File dir1 = Files.createTempDirectory("dir1").toFile();
|
final File dir1 = Files.createTempDirectory("dir1").toFile();
|
||||||
assertTrue(FilePathUtils.isValidDirectoryPath(dir1.getAbsolutePath()));
|
assertTrue(FilePathUtils.isValidDirectoryPath(dir1.getAbsolutePath()));
|
||||||
|
Loading…
Reference in New Issue
Block a user