[eclipse/xtext#1455] Dedicated DocumentTest case for \r\n.

Signed-off-by: Arne Deutsch <Arne.Deutsch@itemis.de>
This commit is contained in:
Arne Deutsch 2019-12-16 13:19:47 +01:00
parent b18bb8ed7c
commit 1fff3d2648
2 changed files with 9 additions and 0 deletions

View file

@ -148,6 +148,10 @@ class DocumentTest {
ccc''').getLineContent(1));
}
@Test def void testGetLineContent_windows_line_endings() {
assertEquals('bbb', new Document(1, "aaa\r\nbbb\r\nccc").getLineContent(1));
}
@Test def void testGetLineCount_empty() {
assertEquals(1, new Document(1, '').lineCount);
}

View file

@ -219,6 +219,11 @@ public class DocumentTest {
Assert.assertEquals("bbb", new Document(Integer.valueOf(1), _builder.toString()).getLineContent(1));
}
@Test
public void testGetLineContent_windows_line_endings() {
Assert.assertEquals("bbb", new Document(Integer.valueOf(1), "aaa\r\nbbb\r\nccc").getLineContent(1));
}
@Test
public void testGetLineCount_empty() {
Assert.assertEquals(1, new Document(Integer.valueOf(1), "").getLineCount());