aboutsummaryrefslogtreecommitdiffstats
path: root/poi-examples/src/test
diff options
context:
space:
mode:
authorDominik Stadler <centic@apache.org>2024-04-22 13:16:10 +0000
committerDominik Stadler <centic@apache.org>2024-04-22 13:16:10 +0000
commit91149769e4fd1855c8dff20472debcdbffd2b462 (patch)
tree2e424536afc461085a2cb57753f8456f2cdc13f2 /poi-examples/src/test
parente6a913c3bde820acec7230aba8888140727348f4 (diff)
downloadpoi-91149769e4fd1855c8dff20472debcdbffd2b462.tar.gz
poi-91149769e4fd1855c8dff20472debcdbffd2b462.zip
Adjust test for XLS2CSV for different newlines on Windows
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1917267 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'poi-examples/src/test')
-rw-r--r--poi-examples/src/test/java/org/apache/poi/examples/hssf/eventusermodel/TestXLS2CSVmra.java16
1 files changed, 10 insertions, 6 deletions
diff --git a/poi-examples/src/test/java/org/apache/poi/examples/hssf/eventusermodel/TestXLS2CSVmra.java b/poi-examples/src/test/java/org/apache/poi/examples/hssf/eventusermodel/TestXLS2CSVmra.java
index c5d9edbf54..f0775ee4e9 100644
--- a/poi-examples/src/test/java/org/apache/poi/examples/hssf/eventusermodel/TestXLS2CSVmra.java
+++ b/poi-examples/src/test/java/org/apache/poi/examples/hssf/eventusermodel/TestXLS2CSVmra.java
@@ -53,7 +53,7 @@ class TestXLS2CSVmra {
outStream.flush();
- assertEquals("\n"
+ assertEquals(sanitize("\n"
+ "First Sheet [1]:\n"
+ "\"Test spreadsheet\"\n"
+ "\"2nd row\",\"2nd row 2nd column\"\n"
@@ -69,7 +69,7 @@ class TestXLS2CSVmra {
+ "\"cb=1\",\"cb=10\",\"cb=2\",\"cb=sum\"\n"
+ "1,10,2,13\n"
+ "\n"
- + "Sheet3 [3]:\n", new String(outStream.toByteArray(), StandardCharsets.UTF_8));
+ + "Sheet3 [3]:\n"), sanitize(new String(outStream.toByteArray(), StandardCharsets.UTF_8)));
}
@Test
@@ -85,12 +85,12 @@ class TestXLS2CSVmra {
outStream.flush();
- assertEquals("\n"
+ assertEquals(sanitize("\n"
+ "Лист1 [1]:\n"
+ "\n"
+ "Лист2 [2]:\n"
+ "\n"
- + "Лист3 [3]:\n", new String(outStream.toByteArray(), StandardCharsets.UTF_8));
+ + "Лист3 [3]:\n"), sanitize(new String(outStream.toByteArray(), StandardCharsets.UTF_8)));
NumberRecord record = new NumberRecord();
@@ -100,12 +100,16 @@ class TestXLS2CSVmra {
outStream.flush();
- assertEquals("\n"
+ assertEquals(sanitize("\n"
+ "Лист1 [1]:\n"
+ "\n"
+ "Лист2 [2]:\n"
+ "\n"
+ "Лист3 [3]:\n"
- + "1.243", new String(outStream.toByteArray(), StandardCharsets.UTF_8));
+ + "1.243"), sanitize(new String(outStream.toByteArray(), StandardCharsets.UTF_8)));
+ }
+
+ private String sanitize(String str) {
+ return str.replace("\r\n", "\n");
}
} \ No newline at end of file