public void shouldProperlyReadStrings() throws IOException {
EndingAwareLineReader reader = new EndingAwareLineReader(new StringReader(TEST_STRING_1));
StringBuilder builder = new StringBuilder();
String line = null;
while ((line = reader.readLine()) != null) {
LineDelimiter lineDelimiter = reader.getLineDelimiter();
builder.append(line);
builder.append(lineDelimiter);
}
assertEquals(TEST_STRING_1, builder.toString());
reader = new EndingAwareLineReader(new StringReader(TEST_STRING_2));
builder = new StringBuilder();
while ((line = reader.readLine()) != null) {
LineDelimiter lineDelimiter = reader.getLineDelimiter();
builder.append(line);
builder.append(lineDelimiter);
}
assertEquals(TEST_STRING_2, builder.toString());
}