You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@plc4x.apache.org by cd...@apache.org on 2021/10/25 12:32:46 UTC
[plc4x] branch feature/mspec-ng updated: - Made the automitgrate
patcher also work on Windows
This is an automated email from the ASF dual-hosted git repository.
cdutz pushed a commit to branch feature/mspec-ng
in repository https://gitbox.apache.org/repos/asf/plc4x.git
The following commit(s) were added to refs/heads/feature/mspec-ng by this push:
new ad43682 - Made the automitgrate patcher also work on Windows
ad43682 is described below
commit ad43682fa861ba9eb27b310c70ccd965a9b7e54d
Author: cdutz <ch...@c-ware.de>
AuthorDate: Mon Oct 25 14:32:37 2021 +0200
- Made the automitgrate patcher also work on Windows
---
.../main/java/org/apache/plc4x/test/migration/TestCasePatcher.java | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/plc4j/utils/test-utils/src/main/java/org/apache/plc4x/test/migration/TestCasePatcher.java b/plc4j/utils/test-utils/src/main/java/org/apache/plc4x/test/migration/TestCasePatcher.java
index 8cd9ce7..eae1bfc 100644
--- a/plc4j/utils/test-utils/src/main/java/org/apache/plc4x/test/migration/TestCasePatcher.java
+++ b/plc4j/utils/test-utils/src/main/java/org/apache/plc4x/test/migration/TestCasePatcher.java
@@ -45,16 +45,16 @@ public class TestCasePatcher {
private static Pattern getPatternForFragment(String xmlFragment) {
StringBuilder patternString = new StringBuilder();
- String[] lines = xmlFragment.split("\n");
+ String[] lines = xmlFragment.split("(\r)?\n");
for (int i = 0; i < lines.length; i++) {
String line = lines[i];
line = StringUtils.replace(line, "\"", "\\\"");
line = StringUtils.replace(line, ".", "\\.");
if (i == 0) {
- patternString.append("([ ]*)").append(line).append("\\n");
+ patternString.append("([ ]*)").append(line).append("(\\r)?\\n");
continue;
}
- patternString.append("[ ]*").append(line).append("\\n");
+ patternString.append("[ ]*").append(line).append("(\\r)?\\n");
}
return Pattern.compile(patternString.toString());
}