mirror of https://github.com/apache/kafka.git
KAFKA-16923 New Unit Test for stripDotPathComponents method (#16259)
Reviewers: Chia-Ping Tsai <chia7712@gmail.com>
This commit is contained in:
parent
7b23976e78
commit
6aa8f3c119
|
@ -34,4 +34,18 @@ public class CommandUtilsTest {
|
|||
assertEquals(Arrays.asList("alpha", "beta"),
|
||||
CommandUtils.splitPath("//alpha/beta/"));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testStripDotPathComponents() {
|
||||
|
||||
//double dots
|
||||
assertEquals(Arrays.asList("keep", "keep2"), CommandUtils.stripDotPathComponents(Arrays.asList("..", "keep", "keep2")));
|
||||
//single dots
|
||||
assertEquals(Arrays.asList("keep", "keep2"), CommandUtils.stripDotPathComponents(Arrays.asList(".", "keep", "keep2")));
|
||||
|
||||
assertEquals(Arrays.asList(".keep", "keep2"), CommandUtils.stripDotPathComponents(Arrays.asList(".", ".keep", "keep2")));
|
||||
|
||||
assertEquals(Arrays.asList(".keep", "keep2"), CommandUtils.stripDotPathComponents(Arrays.asList("..", ".keep", "keep2")));
|
||||
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue