aboutsummaryrefslogtreecommitdiffstats
path: root/unittests/Support/RegexTest.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'unittests/Support/RegexTest.cpp')
-rw-r--r--unittests/Support/RegexTest.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/unittests/Support/RegexTest.cpp b/unittests/Support/RegexTest.cpp
index 02869b3..7b977f7 100644
--- a/unittests/Support/RegexTest.cpp
+++ b/unittests/Support/RegexTest.cpp
@@ -127,4 +127,12 @@ TEST_F(RegexTest, IsLiteralERE) {
EXPECT_FALSE(Regex::isLiteralERE("abc{1,2}"));
}
+TEST_F(RegexTest, IsValid) {
+ std::string Error;
+ EXPECT_FALSE(Regex("(foo").isValid(Error));
+ EXPECT_EQ("parentheses not balanced", Error);
+ EXPECT_FALSE(Regex("a[b-").isValid(Error));
+ EXPECT_EQ("invalid character range", Error);
+}
+
}