From 41613c16e9010a923c7b6be62cee4069d9c27aa8 Mon Sep 17 00:00:00 2001 From: Rene Groeschke Date: Tue, 1 Sep 2020 21:00:27 +0200 Subject: [PATCH] Rework output normalization in build-tools func tests (#61706) (#61721) --- .../gradle/fixtures/AbstractGradleFuncTest.groovy | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/buildSrc/src/integTest/groovy/org/elasticsearch/gradle/fixtures/AbstractGradleFuncTest.groovy b/buildSrc/src/integTest/groovy/org/elasticsearch/gradle/fixtures/AbstractGradleFuncTest.groovy index d3e2abe99c8..3b441478e29 100644 --- a/buildSrc/src/integTest/groovy/org/elasticsearch/gradle/fixtures/AbstractGradleFuncTest.groovy +++ b/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") }