From 5ce7c78ea3e86527b0e9138f505161f0ee646eb0 Mon Sep 17 00:00:00 2001 From: Roman Chernyatchik Date: Tue, 16 Dec 2008 22:11:59 +0300 Subject: [PATCH] fixed [RUBY-2553] : Dynamically generated value inspection reacts on value substitution --- .../src/com/intellij/testFramework/ExpectedHighlightingData.java | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/ExtendedApi/src/com/intellij/testFramework/ExpectedHighlightingData.java b/ExtendedApi/src/com/intellij/testFramework/ExpectedHighlightingData.java index 6994624ff6..64b5237a25 100644 --- a/ExtendedApi/src/com/intellij/testFramework/ExpectedHighlightingData.java +++ b/ExtendedApi/src/com/intellij/testFramework/ExpectedHighlightingData.java @@ -169,7 +169,7 @@ public class ExpectedHighlightingData { // er... // any code then (with optional descr="...") then any code then then any code - @NonNls String pat = ".*?(<(" + typesRegex + ")(?: descr=\"((?:[^\"\\\\]|\\\\\")*)\")?(?: type=\"([0-9A-Z_]+)\")?(?: foreground=\"([0-9xa-f]+)\")?(?: background=\"([0-9xa-f]+)\")?(?: effectcolor=\"([0-9xa-f]+)\")?(?: effecttype=\"([A-Z]+)\")?(?: fonttype=\"([0-9]+)\")?(/)?>)(.*)"; + @NonNls String pat = ".*?(<(" + typesRegex + ")(?: descr=\"((?:[^\"\\\\]|\\\\\"|\\\\\\\\\")*)\")?(?: type=\"([0-9A-Z_]+)\")?(?: foreground=\"([0-9xa-f]+)\")?(?: background=\"([0-9xa-f]+)\")?(?: effectcolor=\"([0-9xa-f]+)\")?(?: effecttype=\"([A-Z]+)\")?(?: fonttype=\"([0-9]+)\")?(/)?>)(.*)"; //"(.+?)).*"; Pattern p = Pattern.compile(pat, Pattern.DOTALL); Out: @@ -197,6 +197,11 @@ public class ExpectedHighlightingData { descr = null; } + // replace: \\" to ", doesn't check symbol before sequence \\" + if (descr != null) { + descr = descr.replaceAll("\\\\\\\\\"", "\""); + } + String typeString = m.group(pos++); String foregroundColor = m.group(pos++); String backgroundColor = m.group(pos++); @@ -425,4 +430,4 @@ public class ExpectedHighlightingData { && (expectedInfo.forcedTextAttributes == null || expectedInfo.getTextAttributes(null).equals(info.getTextAttributes(null))) ; } -} +} \ No newline at end of file -- 2.11.4.GIT