Browse Source

HADOOP-19562. Fix TestTextCommand on Windows (#7679)

* The following 2 tests are failing in TestTextCommand -
  1. testDisplayForNonWritableSequenceFile
  2. testDisplayForSequenceFileSmallMultiByteReads
* These tests create a file and flush a string ending
  with "\n". However, for verification, the tests
  expect "\r\n" as the line ending on Windows.
  Thus, the test fails.
* This PR fixes the same by checking for "\n" as the
  line ending on Windows.
Gautham B A 2 weeks ago
parent
commit
912c26035e

+ 1 - 1
hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/fs/shell/TestTextCommand.java

@@ -64,7 +64,7 @@ public class TestTextCommand {
       + "{\"station\":\"012650-99999\",\"time\":-655509600000,\"temp\":78}" + SEPARATOR;
 
   private static final String SEQUENCE_FILE_EXPECTED_OUTPUT =
-      "Key1\tValue1" + SEPARATOR + "Key2\tValue2" + SEPARATOR;
+      "Key1\tValue1\nKey2\tValue2\n";
 
   @Rule
   public final Timeout testTimeout = new Timeout(30000);