Skip to content
This repository was archived by the owner on Nov 11, 2022. It is now read-only.

Commit d24cb94

Browse files
chamikaramjdavorbonaci
authored andcommitted
Updated TestFileBasedSource.TestReader so that lines are read properly when running on Windows.
----Release Notes---- [] ------------- Created by MOE: http://code.google.com/p/moe-java MOE_MIGRATED_REVID=89422772
1 parent 7cbc12a commit d24cb94

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

sdk/src/test/java/com/google/cloud/dataflow/sdk/io/FileBasedSourceTest.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -209,7 +209,9 @@ protected boolean readNextRecord() throws IOException {
209209
}
210210
nextOffset += offsetAdjustment;
211211
isAtSplitPoint = true;
212-
currentValue = CoderUtils.decodeFromByteArray(StringUtf8Coder.of(), buf.toByteArray());
212+
// When running on Windows, each line obtained from 'readNextLine()' will end with a '\r'
213+
// since we use '\n' as the line boundary of the reader. So we trim it off here.
214+
currentValue = CoderUtils.decodeFromByteArray(StringUtf8Coder.of(), buf.toByteArray()).trim();
213215
return true;
214216
}
215217

0 commit comments

Comments
 (0)