diff options
author | Daniel Jasper <djasper@google.com> | 2014-05-12 11:29:50 +0000 |
---|---|---|
committer | Daniel Jasper <djasper@google.com> | 2014-05-12 11:29:50 +0000 |
commit | fb4333b093352de9298fff0f5307d60953a3520b (patch) | |
tree | c720526310768755365d051eb49bd488328de18f /clang/unittests/Format/FormatTestJS.cpp | |
parent | 238c7c165b80444d4bac96632418720ca10f5748 (diff) | |
download | bcm5719-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.cpp | 3 |
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) { |