diff options
author | Daniel Jasper <djasper@google.com> | 2015-07-02 15:00:44 +0000 |
---|---|---|
committer | Daniel Jasper <djasper@google.com> | 2015-07-02 15:00:44 +0000 |
commit | f144620cc19a51268199b2661e7097d9ab0448e4 (patch) | |
tree | 526ec5eb4a5ff8ee90897727ca77aa8316079339 /clang/unittests/Format/FormatTestJS.cpp | |
parent | 07d4496ab7c7dbad8e43fe621b09f600ba678b3c (diff) | |
download | bcm5719-llvm-f144620cc19a51268199b2661e7097d9ab0448e4.tar.gz bcm5719-llvm-f144620cc19a51268199b2661e7097d9ab0448e4.zip |
clang-format: [JS] Treat regex literals like string literals.
Using the token type "unknown" can interfere badly with
WhitespaceManager's way of handling multiline comments.
llvm-svn: 241273
Diffstat (limited to 'clang/unittests/Format/FormatTestJS.cpp')
-rw-r--r-- | clang/unittests/Format/FormatTestJS.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/clang/unittests/Format/FormatTestJS.cpp b/clang/unittests/Format/FormatTestJS.cpp index ef5901e8d69..b3e0f68ac3b 100644 --- a/clang/unittests/Format/FormatTestJS.cpp +++ b/clang/unittests/Format/FormatTestJS.cpp @@ -638,6 +638,10 @@ TEST_F(FormatTestJS, RegexLiteralSpecialCharacters) { getGoogleJSStyleWithColumns(15)); verifyFormat("var regex = //\n" " /a/;"); + verifyFormat("var regexs = [\n" + " /d/, //\n" + " /aa/, //\n" + "];"); } TEST_F(FormatTestJS, RegexLiteralModifiers) { |