diff options
author | Daniel Jasper <djasper@google.com> | 2015-07-02 14:01:34 +0000 |
---|---|---|
committer | Daniel Jasper <djasper@google.com> | 2015-07-02 14:01:34 +0000 |
commit | 55c384e039ebe1b6fb2e965cccb5f8e4217fbc98 (patch) | |
tree | 26b8635db5964fdda2faf5266bf6b4543e63a3df /clang/unittests/Format/FormatTestJS.cpp | |
parent | 3d2ba47a90a9c9d8ec78cd5b1079507c82ba2c3d (diff) | |
download | bcm5719-llvm-55c384e039ebe1b6fb2e965cccb5f8e4217fbc98.tar.gz bcm5719-llvm-55c384e039ebe1b6fb2e965cccb5f8e4217fbc98.zip |
clang-format: [JS] Fix bug in regex literal parsing.
The lexer wasn't properly reset leading to unexpected deletions.
llvm-svn: 241262
Diffstat (limited to 'clang/unittests/Format/FormatTestJS.cpp')
-rw-r--r-- | clang/unittests/Format/FormatTestJS.cpp | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/clang/unittests/Format/FormatTestJS.cpp b/clang/unittests/Format/FormatTestJS.cpp index 83c21183dfd..40a2a1ffe63 100644 --- a/clang/unittests/Format/FormatTestJS.cpp +++ b/clang/unittests/Format/FormatTestJS.cpp @@ -631,6 +631,7 @@ TEST_F(FormatTestJS, RegexLiteralSpecialCharacters) { "var x = 0;", format("var regex = /\\/*/;\n" "var x=0;")); + EXPECT_EQ("var x = /a\\//;", format("var x = /a\\// \n;")); verifyFormat("var regex = /\"/;", getGoogleJSStyleWithColumns(16)); verifyFormat("var regex =\n" " /\"/;", |