Skip to content

Commit 64e01c6

Browse files
committed
Fix test by proper indication of line separator
See #296.
1 parent 993d1f5 commit 64e01c6

File tree

1 file changed

+23
-9
lines changed

1 file changed

+23
-9
lines changed

metafacture-strings/src/test/java/org/metafacture/strings/LineRecorderTest.java

Lines changed: 23 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -32,18 +32,20 @@
3232
*/
3333
public final class LineRecorderTest {
3434

35-
private static final String RECORD1_PART1 = "a1\n";
36-
private static final String RECORD1_PART2 = "a2\n";
35+
private static final String RECORD1_PART1 = "a1";
36+
private static final String RECORD1_PART2 = "a2";
3737
private static final String RECORD1_ENDMARKER = "\n";
3838

39-
private static final String RECORD2_PART1 = "b1\n";
40-
private static final String RECORD2_PART2 = "b2\n";
39+
private static final String RECORD2_PART1 = "b1";
40+
private static final String RECORD2_PART2 = "b2";
4141
private static final String RECORD2_ENDMARKER = "\n";
4242

43-
private static final String RECORD3_PART1 = "c1\n";
44-
private static final String RECORD3_PART2 = "c2\n";
43+
private static final String RECORD3_PART1 = "c1";
44+
private static final String RECORD3_PART2 = "c2";
4545
private static final String RECORD3_ENDMARKER = "EOR";
4646

47+
private static final String LINE_SEPARATOR = "\n";
48+
4749
private LineRecorder lineRecorder;
4850

4951
@Mock
@@ -63,13 +65,21 @@ public void shouldEmitRecords() {
6365
lineRecorder.process(RECORD1_ENDMARKER);
6466

6567
final InOrder ordered = inOrder(receiver);
66-
ordered.verify(receiver).process(RECORD1_PART1 + RECORD1_PART2);
68+
ordered.verify(receiver).process(
69+
RECORD1_PART1 +
70+
LINE_SEPARATOR +
71+
RECORD1_PART2 +
72+
LINE_SEPARATOR);
6773

6874
lineRecorder.process(RECORD2_PART1);
6975
lineRecorder.process(RECORD2_PART2);
7076
lineRecorder.process(RECORD2_ENDMARKER);
7177

72-
ordered.verify(receiver).process(RECORD2_PART1 + RECORD2_PART2);
78+
ordered.verify(receiver).process(
79+
RECORD2_PART1 +
80+
LINE_SEPARATOR +
81+
RECORD2_PART2 +
82+
LINE_SEPARATOR);
7383
ordered.verifyNoMoreInteractions();
7484
}
7585

@@ -81,7 +91,11 @@ public void shouldEmitRecordWithNonDefaultRecordMarker() {
8191
lineRecorder.process(RECORD3_ENDMARKER);
8292

8393
final InOrder ordered = inOrder(receiver);
84-
ordered.verify(receiver).process(RECORD3_PART1 + RECORD3_PART2);
94+
ordered.verify(receiver).process(
95+
RECORD3_PART1 +
96+
LINE_SEPARATOR +
97+
RECORD3_PART2 +
98+
LINE_SEPARATOR);
8599
ordered.verifyNoMoreInteractions();
86100
}
87101

0 commit comments

Comments
 (0)