Skip to content

Commit e1f2f4a

Browse files
author
Gary Gregory
committed
Add missing AccumulatorPathVisitor test
1 parent 426a793 commit e1f2f4a

1 file changed

Lines changed: 11 additions & 0 deletions

File tree

src/test/java/org/apache/commons/io/file/AccumulatorPathVisitorTest.java

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@
4444
import org.apache.commons.io.filefilter.EmptyFileFilter;
4545
import org.apache.commons.io.filefilter.PathVisitorFileFilter;
4646
import org.apache.commons.io.function.IOBiFunction;
47+
import org.junit.jupiter.api.Test;
4748
import org.junit.jupiter.api.io.TempDir;
4849
import org.junit.jupiter.params.ParameterizedTest;
4950
import org.junit.jupiter.params.provider.Arguments;
@@ -76,6 +77,16 @@ static Stream<Arguments> testParametersIgnoreFailures() {
7677
@TempDir
7778
Path tempDirPath;
7879

80+
@Test
81+
public void test0ArgConstructor() throws IOException {
82+
final AccumulatorPathVisitor accPathVisitor = new AccumulatorPathVisitor();
83+
final PathVisitorFileFilter countingFileFilter = new PathVisitorFileFilter(accPathVisitor);
84+
Files.walkFileTree(tempDirPath, new AndFileFilter(countingFileFilter, DirectoryFileFilter.INSTANCE, EmptyFileFilter.EMPTY));
85+
assertCounts(0, 0, 0, accPathVisitor.getPathCounters());
86+
assertEquals(1, accPathVisitor.getDirList().size());
87+
assertTrue(accPathVisitor.getFileList().isEmpty());
88+
}
89+
7990
/**
8091
* Tests an empty folder.
8192
*/

0 commit comments

Comments
 (0)