Browse Source

Rework output normalization in build-tools func tests (#61706)

Rene Groeschke 5 years ago
parent
commit
e77c8efbee

+ 3 - 5
buildSrc/src/integTest/groovy/org/elasticsearch/gradle/fixtures/AbstractGradleFuncTest.groovy

@@ -57,12 +57,10 @@ abstract class AbstractGradleFuncTest extends Specification {
     }
 
     String normalizedOutput(String input) {
+        String normalizedPathPrefix = testProjectDir.root.canonicalPath.replace('\\', '/')
         return input.readLines()
-                .collect { it.replaceAll("\\\\", "/") }
-                .collect {
-                    it.replaceAll(
-                            testProjectDir.root.canonicalPath.replaceAll('\\\\', '/'), ".")
-                }
+                .collect { it.replace('\\', '/') }
+                .collect {it.replace(normalizedPathPrefix , '.') }
                 .join("\n")
     }