Skip to content

Commit

Permalink
add: add test cases for FileUtil (#8810)
Browse files Browse the repository at this point in the history
* add: add test cases for FileUtil

* del: other

* fix: list of

* fix: list of

Co-authored-by: Christina Chen <wenjunc3@uci.edu>
  • Loading branch information
Christina0114 and Christina Chen authored May 18, 2022
1 parent 82aad89 commit 42672e3
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions src/test/java/org/jabref/logic/util/io/FileUtilTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -387,4 +387,18 @@ void testIsNotBibFile() throws IOException {
Path bibFile = Files.createFile(rootDir.resolve("test.pdf"));
assertFalse(FileUtil.isBibFile(bibFile));
}

@Test
void testFindinPath() {
Optional<Path> resultPath1 = FileUtil.find("existingTestFile.txt", rootDir);
assertEquals(resultPath1.get().toString(), existingTestFile.toString());
}

@Test
void testFindinListofPath() {
List<Path> paths = List.of(existingTestFile, otherExistingTestFile, rootDir);
List<Path> resultPaths = List.of(existingTestFile, existingTestFile);
List<Path> result = FileUtil.find("existingTestFile.txt", paths);
assertEquals(resultPaths, result);
}
}

0 comments on commit 42672e3

Please sign in to comment.