diff --git a/platform/structuralsearch/testSource/com/intellij/structuralsearch/impl/matcher/compiler/StringToConstraintsTransformerTest.java b/platform/structuralsearch/testSource/com/intellij/structuralsearch/impl/matcher/compiler/StringToConstraintsTransformerTest.java index 424de997d9df..0748262e919a 100644 --- a/platform/structuralsearch/testSource/com/intellij/structuralsearch/impl/matcher/compiler/StringToConstraintsTransformerTest.java +++ b/platform/structuralsearch/testSource/com/intellij/structuralsearch/impl/matcher/compiler/StringToConstraintsTransformerTest.java @@ -24,6 +24,7 @@ import org.junit.Before; import org.junit.Test; import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertTrue; /** @@ -227,6 +228,19 @@ public class StringToConstraintsTransformerTest { assertEquals(".*(?:comment).*", constraint1.getRegExp()); } + @Test + public void testInvert() { + test("'a:[!regexw(a)&&formal(*List)]"); + assertEquals("$a$", myOptions.getSearchPattern()); + final MatchVariableConstraint constraint = myOptions.getVariableConstraint("a"); + assertTrue(constraint.isWholeWordsOnly()); + assertEquals("a", constraint.getRegExp()); + assertTrue(constraint.isInvertRegExp()); + assertTrue(constraint.isFormalArgTypeWithinHierarchy()); + assertFalse(constraint.isInvertFormalType()); + assertEquals("List", constraint.getNameOfFormalArgType()); + } + @Test(expected = MalformedPatternException.class) public void testAmpersandsExpected() { test("'a:[regex(a) regex(b)]");