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 | 86396e9b53c3aff75b2d53f92b0368c858f4189e (patch) | |
tree | 38c369137d249b79314dfdd41c3cef20ffc80053 /unittests | |
parent | 5473fec717995f7fce8f81187ba6e61dfb959bf5 (diff) | |
download | clang-86396e9b53c3aff75b2d53f92b0368c858f4189e.tar.gz |
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.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@208539 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'unittests')
-rw-r--r-- | unittests/Format/FormatTestJS.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/unittests/Format/FormatTestJS.cpp b/unittests/Format/FormatTestJS.cpp index cc67416493..7a853b0378 100644 --- a/unittests/Format/FormatTestJS.cpp +++ b/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) { |