summaryrefslogtreecommitdiffstats
path: root/clang/unittests/Format/FormatTestJS.cpp
diff options
context:
space:
mode:
authorDaniel Jasper <djasper@google.com>2014-05-12 11:29:50 +0000
committerDaniel Jasper <djasper@google.com>2014-05-12 11:29:50 +0000
commitfb4333b093352de9298fff0f5307d60953a3520b (patch)
treec720526310768755365d051eb49bd488328de18f /clang/unittests/Format/FormatTestJS.cpp
parent238c7c165b80444d4bac96632418720ca10f5748 (diff)
downloadbcm5719-llvm-fb4333b093352de9298fff0f5307d60953a3520b.tar.gz
bcm5719-llvm-fb4333b093352de9298fff0f5307d60953a3520b.zip
clang-format: [JS] Basic support for escape sequences in regex literals.
Before: var regex = /\\/ g; // This isn't even recognized as regex. After: var regex = /\\/g; // It now is. llvm-svn: 208539
Diffstat (limited to 'clang/unittests/Format/FormatTestJS.cpp')
-rw-r--r--clang/unittests/Format/FormatTestJS.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/clang/unittests/Format/FormatTestJS.cpp b/clang/unittests/Format/FormatTestJS.cpp
index cc674164930..7a853b03781 100644
--- a/clang/unittests/Format/FormatTestJS.cpp
+++ b/clang/unittests/Format/FormatTestJS.cpp
@@ -180,6 +180,9 @@ TEST_F(FormatTestJS, RegexLiteralSpecialCharacters) {
verifyFormat("var regex = /\\W/;");
verifyFormat("var regex = /a(a)\\1/;");
verifyFormat("var regex = /\\0/;");
+ verifyFormat("var regex = /\\\\/g;");
+ verifyFormat("var regex = /\\a\\\\/g;");
+ verifyFormat("var regex = /\a\\//g;");
}
TEST_F(FormatTestJS, RegexLiteralModifiers) {
OpenPOWER on IntegriCloud