From 7acddaf60837c41b9c9ab43f5be69e6c75f3c4e1 Mon Sep 17 00:00:00 2001 From: Pascal Weyprecht Date: Fri, 20 Sep 2024 14:30:27 +0200 Subject: [PATCH] Fixed test failing because of whitespaces testIncludesDebugSettings compares a string and fails (in windows) because of whitespace differences. Fixed to ignore different whitespaces. Also-by: Ralf Schlesinger --- .../rap/rwt/internal/resources/ClientResources_Test.java | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/tests/org.eclipse.rap.rwt.test/src/org/eclipse/rap/rwt/internal/resources/ClientResources_Test.java b/tests/org.eclipse.rap.rwt.test/src/org/eclipse/rap/rwt/internal/resources/ClientResources_Test.java index c9ef6ad703..3a527345dc 100644 --- a/tests/org.eclipse.rap.rwt.test/src/org/eclipse/rap/rwt/internal/resources/ClientResources_Test.java +++ b/tests/org.eclipse.rap.rwt.test/src/org/eclipse/rap/rwt/internal/resources/ClientResources_Test.java @@ -16,6 +16,8 @@ import java.io.IOException; import java.io.InputStream; +import java.util.regex.Matcher; +import java.util.regex.Pattern; import org.eclipse.rap.rwt.RWT; import org.eclipse.rap.rwt.internal.RWTProperties; @@ -81,7 +83,11 @@ public void testIncludesDebugSettings() throws IOException { String content = getRegisteredContent( RAP_CLIENT_JS_PATH ); - assertTrue( content.contains( "qxvariants = {\n \"qx.debug\" : \"on\"\n};" ) ); + // Pattern: .*qxvariants\W*=\W*\{\W*\"qx.debug\"\W*:\W*\"on\"\W*\};.* + String patternString = ".*qxvariants\\W*=\\W*\\{\\W*\\\"qx.debug\\\"\\W*:\\W*\\\"on\\\"\\W*\\};.*"; + Pattern pattern = Pattern.compile(patternString, Pattern.MULTILINE); + Matcher matcher = pattern.matcher(content); + assertTrue( matcher.find()); } @Test