summaryrefslogtreecommitdiff
path: root/unittests
diff options
context:
space:
mode:
Diffstat (limited to 'unittests')
-rw-r--r--unittests/Support/RegexTest.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/unittests/Support/RegexTest.cpp b/unittests/Support/RegexTest.cpp
index 7b977f7446..abc8d0f38e 100644
--- a/unittests/Support/RegexTest.cpp
+++ b/unittests/Support/RegexTest.cpp
@@ -127,6 +127,11 @@ TEST_F(RegexTest, IsLiteralERE) {
EXPECT_FALSE(Regex::isLiteralERE("abc{1,2}"));
}
+TEST_F(RegexTest, Escape) {
+ EXPECT_EQ(Regex::escape("a[bc]"), "a\\[bc\\]");
+ EXPECT_EQ(Regex::escape("abc{1\\,2}"), "abc\\{1\\\\,2\\}");
+}
+
TEST_F(RegexTest, IsValid) {
std::string Error;
EXPECT_FALSE(Regex("(foo").isValid(Error));