Skip to content

Commit 197e4a2

Browse files
author
Vladimir Kotal
authored
normalize newlines (#2308)
1 parent a002762 commit 197e4a2

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

opengrok-indexer/src/test/java/org/opengrok/indexer/analysis/haskell/HaskellXrefTest.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -122,8 +122,8 @@ public void sampleTest() throws IOException {
122122
expectedOutputSteam.close();
123123
}
124124

125-
String actual[] = new String(sampleOutputStream.toByteArray(), "UTF-8").split("\n");
126-
String expected[] = new String(expectedOutputSteam.toByteArray(), "UTF-8").split("\n");
125+
String actual[] = new String(sampleOutputStream.toByteArray(), "UTF-8").split("\\r?\\n");
126+
String expected[] = new String(expectedOutputSteam.toByteArray(), "UTF-8").split("\\r?\\n");
127127
assertLinesEqual("Haskell sampleTest()", expected, actual);
128128
assertEquals("Haskell LOC", 3, actLOC);
129129
}
@@ -161,7 +161,7 @@ private void writeAndCompare(String sourceResource, String resultResource,
161161
baos.close();
162162

163163
String ostr = new String(baos.toByteArray(), "UTF-8");
164-
String gotten[] = ostr.split("\n");
164+
String gotten[] = ostr.split("\\r?\\n");
165165

166166
String estr = new String(expbytes, "UTF-8");
167167
String expected[] = estr.split("\n");

opengrok-indexer/src/test/java/org/opengrok/indexer/analysis/php/PhpXrefTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ public void sampleTest() throws IOException {
136136
"analysis/php/sampleXrefRes.html");
137137
byte[] expbytes = copyStream(exp);
138138

139-
String gotten[] = new String(baos.toByteArray(), "UTF-8").split("\n");
139+
String gotten[] = new String(baos.toByteArray(), "UTF-8").split("\\r?\\n");
140140
String expected[] = new String(expbytes, "UTF-8").split("\n");
141141
assertLinesEqual("PHP xref", expected, gotten);
142142
assertEquals("PHP LOC", 29, actLOC);

0 commit comments

Comments
 (0)