mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
SSR: add new invert test to replace removed old one
This commit is contained in:
+14
@@ -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)]");
|
||||
|
||||
Reference in New Issue
Block a user