Skip to content

Commit 729f19f

Browse files
HADOOP-19603. Fix TestFsShellList.testList on Windows (#7771)
* The test `org.apache.hadoop.fs.TestFsShellList#testList` creates files with special characters and tries to list them using `ls`. * Filenames with special characters aren't allowed on Windows. * Thus, we need to modify the test to only test for non-special characters on Windows and include the filenames with special characters on non-Windows environments.
1 parent 11cbda4 commit 729f19f

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/fs/TestFsShellList.java

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,9 +66,12 @@ public void testList() throws Exception {
6666
String[] lsArgv = new String[]{"-ls", testRootDir.toString()};
6767
assertThat(shell.run(lsArgv)).isEqualTo(0);
6868

69-
createFile(new Path(testRootDir, "abc\bd\tef"));
69+
if (!Path.WINDOWS) {
70+
createFile(new Path(testRootDir, "abc\bd\tef"));
71+
createFile(new Path(testRootDir, "qq\r123"));
72+
}
73+
7074
createFile(new Path(testRootDir, "ghi"));
71-
createFile(new Path(testRootDir, "qq\r123"));
7275
lsArgv = new String[]{"-ls", testRootDir.toString()};
7376
assertThat(shell.run(lsArgv)).isEqualTo(0);
7477

0 commit comments

Comments
 (0)