diff --git a/python/python.iml b/python/python.iml
index 57624ffc30b3..aa0cfdc9decb 100644
--- a/python/python.iml
+++ b/python/python.iml
@@ -23,7 +23,7 @@
-
+
diff --git a/python/testData/regexp/braceInPythonCharacterClass.py b/python/testData/regexp/braceInPythonCharacterClass.py
new file mode 100644
index 000000000000..8066c64a120e
--- /dev/null
+++ b/python/testData/regexp/braceInPythonCharacterClass.py
@@ -0,0 +1,3 @@
+import re
+
+EXTRANEOUS_WHITESPACE_REGEX = re.compile(r'[[({] | []}),;:]')
diff --git a/python/testSrc/com/jetbrains/python/PyRegexpTest.java b/python/testSrc/com/jetbrains/python/PyRegexpTest.java
index 23bbb8869ed2..207b2cb2e242 100644
--- a/python/testSrc/com/jetbrains/python/PyRegexpTest.java
+++ b/python/testSrc/com/jetbrains/python/PyRegexpTest.java
@@ -1,5 +1,8 @@
package com.jetbrains.python;
+import com.intellij.lexer.Lexer;
+import com.jetbrains.python.codeInsight.regexp.PythonRegexpParserDefinition;
+import com.jetbrains.python.fixtures.PyLexerTestCase;
import com.jetbrains.python.fixtures.PyLightFixtureTestCase;
/**
@@ -10,6 +13,11 @@ public class PyRegexpTest extends PyLightFixtureTestCase {
doTest();
}
+ public void testNestedCharacterClassesLexer() {
+ Lexer lexer = new PythonRegexpParserDefinition().createLexer(myFixture.getProject());
+ PyLexerTestCase.doLexerTest("[][]", lexer, "CLASS_BEGIN", "CHARACTER", "CHARACTER", "CLASS_END");
+ }
+
public void testNestedCharacterClasses2() { // PY-2908
doTest();
}
@@ -18,6 +26,10 @@ public class PyRegexpTest extends PyLightFixtureTestCase {
doTest();
}
+ public void testBraceInPythonCharacterClass() { // PY-1929
+ doTest();
+ }
+
private void doTest() {
myFixture.testHighlighting(true, false, false, "regexp/" + getTestName(true) + ".py");
}
diff --git a/python/testSrc/com/jetbrains/python/fixtures/PyLexerTestCase.java b/python/testSrc/com/jetbrains/python/fixtures/PyLexerTestCase.java
index 4c9667576185..9e3a0f16e01d 100644
--- a/python/testSrc/com/jetbrains/python/fixtures/PyLexerTestCase.java
+++ b/python/testSrc/com/jetbrains/python/fixtures/PyLexerTestCase.java
@@ -7,7 +7,7 @@ import junit.framework.TestCase;
* @author yole
*/
public abstract class PyLexerTestCase extends TestCase {
- protected static void doLexerTest(String text, Lexer lexer, String... expectedTokens) {
+ public static void doLexerTest(String text, Lexer lexer, String... expectedTokens) {
lexer.start(text);
int idx = 0;
int tokenPos = 0;