From d4a7e7354554b997f61722bb86ee1fd2c2e81e2f Mon Sep 17 00:00:00 2001 From: Anna Kozlova Date: Fri, 7 May 2021 22:39:17 +0200 Subject: [PATCH] test framework: allow to omit text attribute in expected data to match null in actual data GitOrigin-RevId: cfed6f6b4162974cb5ef6d725269b5a7b41ea8bd --- .../com/intellij/testFramework/ExpectedHighlightingData.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/platform/testFramework/src/com/intellij/testFramework/ExpectedHighlightingData.java b/platform/testFramework/src/com/intellij/testFramework/ExpectedHighlightingData.java index 0994431d375b..bca230cc6985 100644 --- a/platform/testFramework/src/com/intellij/testFramework/ExpectedHighlightingData.java +++ b/platform/testFramework/src/com/intellij/testFramework/ExpectedHighlightingData.java @@ -297,9 +297,10 @@ public class ExpectedHighlightingData { TextAttributes forcedAttributes = null; if (foregroundColor != null) { - @JdkConstants.FontStyle int ft = Integer.parseInt(fontType); + @JdkConstants.FontStyle int ft = fontType != null ? Integer.parseInt(fontType) : 0; forcedAttributes = new TextAttributes( - Color.decode(foregroundColor), Color.decode(backgroundColor), Color.decode(effectColor), EffectType.valueOf(effectType), ft); + Color.decode(foregroundColor), backgroundColor != null ? Color.decode(backgroundColor) : null, effectColor != null ? Color.decode(effectColor) : null, + effectType != null ? EffectType.valueOf(effectType) : null, ft); } int rangeStart = textOffset.get();