From 95508ac3fc1c758261bee52c4bd8d249b5acc350 Mon Sep 17 00:00:00 2001
From: Big Andy <8012398+big-andy-coates@users.noreply.github.com>
Date: Fri, 22 Dec 2023 19:16:30 +0000
Subject: [PATCH] Fix tests to work on windows too.
---
.../test/executor/cli/PicoCliParserTest.java | 14 +++++++-------
.../executor/result/xml/XmlTestCaseResultTest.java | 4 ++--
.../result/xml/XmlTestSuiteResultTest.java | 2 +-
3 files changed, 10 insertions(+), 10 deletions(-)
diff --git a/executor/src/test/java/org/creekservice/internal/system/test/executor/cli/PicoCliParserTest.java b/executor/src/test/java/org/creekservice/internal/system/test/executor/cli/PicoCliParserTest.java
index 7a82a25e..0f422802 100644
--- a/executor/src/test/java/org/creekservice/internal/system/test/executor/cli/PicoCliParserTest.java
+++ b/executor/src/test/java/org/creekservice/internal/system/test/executor/cli/PicoCliParserTest.java
@@ -555,15 +555,15 @@ void shouldImplementToStringOnMinimalOptions() {
@Test
void shouldImplementToStringOnFullOptions() {
// Given:
- final Path mrS0 = Path.of(File.separator, "a", "b");
- final Path mrD0 = Path.of(File.separator, "c");
+ final Path mrS0 = Path.of("a", "b");
+ final Path mrD0 = Path.of("c");
final Path mrS1 = Path.of("d", "e");
- final Path mrD1 = Path.of(File.separator, "f");
+ final Path mrD1 = Path.of("f");
- final Path mwS0 = Path.of(File.separator, "a");
- final Path mwD0 = Path.of(File.separator, "b", "c");
- final Path mwS1 = Path.of(File.separator, "d");
- final Path mwD1 = Path.of(File.separator, "f");
+ final Path mwS0 = Path.of("a");
+ final Path mwD0 = Path.of("b", "c");
+ final Path mwS1 = Path.of("d");
+ final Path mwD1 = Path.of("g");
final String[] args =
minimalArgs(
diff --git a/executor/src/test/java/org/creekservice/internal/system/test/executor/result/xml/XmlTestCaseResultTest.java b/executor/src/test/java/org/creekservice/internal/system/test/executor/result/xml/XmlTestCaseResultTest.java
index 07b2193a..c91b2654 100644
--- a/executor/src/test/java/org/creekservice/internal/system/test/executor/result/xml/XmlTestCaseResultTest.java
+++ b/executor/src/test/java/org/creekservice/internal/system/test/executor/result/xml/XmlTestCaseResultTest.java
@@ -108,7 +108,7 @@ void shouldSerializeFailed() throws Exception {
+ lineSeparator()
+ " "
- + stackTrace
+ + stackTrace.replaceAll("\r", "
")
+ ""
+ lineSeparator()
+ ""
@@ -133,7 +133,7 @@ void shouldSerializeError() throws Exception {
+ lineSeparator()
+ " "
- + stackTrace.replaceAll(lineSeparator(), "\n")
+ + stackTrace.replaceAll("\r", "
")
+ ""
+ lineSeparator()
+ ""
diff --git a/executor/src/test/java/org/creekservice/internal/system/test/executor/result/xml/XmlTestSuiteResultTest.java b/executor/src/test/java/org/creekservice/internal/system/test/executor/result/xml/XmlTestSuiteResultTest.java
index 6e293f77..58701a82 100644
--- a/executor/src/test/java/org/creekservice/internal/system/test/executor/result/xml/XmlTestSuiteResultTest.java
+++ b/executor/src/test/java/org/creekservice/internal/system/test/executor/result/xml/XmlTestSuiteResultTest.java
@@ -129,7 +129,7 @@ void shouldSerializeSuiteError() throws Exception {
+ lineSeparator()
+ " "
- + stackTrace.replaceAll(lineSeparator(), "\n")
+ + stackTrace.replaceAll("\r", "
")
+ ""
+ lineSeparator()
+ ""