|
@@ -40,6 +40,10 @@ func TestRegExp(t *testing.T) {
|
|
|
test("(?U)", "", "Invalid group")
|
|
|
test("(?)|(?i)", "", "Invalid group")
|
|
|
test("(?P<w>)(?P<w>)(?P<D>)", "", "Invalid group")
|
|
|
+
|
|
|
+ test(`<%([\s\S]+?)%>`, `<%([`+WhitespaceChars+`S]+?)%>`, "S in class")
|
|
|
+
|
|
|
+ test("(?<=y)x", "(?<=y)x", "re2: Invalid (?<) <lookbehind>")
|
|
|
}
|
|
|
|
|
|
{
|
|
@@ -52,11 +56,6 @@ func TestRegExp(t *testing.T) {
|
|
|
is(err, nil)
|
|
|
}
|
|
|
|
|
|
- testErr := func(input string, expectErr string) {
|
|
|
- _, err := TransformRegExp(input)
|
|
|
- is(err, expectErr)
|
|
|
- }
|
|
|
-
|
|
|
test("", "")
|
|
|
|
|
|
test("abc", "abc")
|
|
@@ -109,8 +108,6 @@ func TestRegExp(t *testing.T) {
|
|
|
|
|
|
test("\\04", "\\x04")
|
|
|
|
|
|
- testErr(`<%([\s\S]+?)%>`, "S in class")
|
|
|
-
|
|
|
test(`(.)^`, "([^\\r\\n])^")
|
|
|
|
|
|
test(`\$`, `\$`)
|