diff options
author | Daniel Jasper <djasper@google.com> | 2016-02-01 11:20:47 +0000 |
---|---|---|
committer | Daniel Jasper <djasper@google.com> | 2016-02-01 11:20:47 +0000 |
commit | 1ce41112a43005b3ac2ee24119f2e633d86a27f5 (patch) | |
tree | 08294210b03bfba01865923e0a104cd435c25b00 /clang/unittests/Format/FormatTestJS.cpp | |
parent | a5b8ea0d66c2316275e51a50a5a4341c1a990868 (diff) | |
download | bcm5719-llvm-1ce41112a43005b3ac2ee24119f2e633d86a27f5.tar.gz bcm5719-llvm-1ce41112a43005b3ac2ee24119f2e633d86a27f5.zip |
clang-format: [JS] Treat "in" as a proper operator.
llvm-svn: 259350
Diffstat (limited to 'clang/unittests/Format/FormatTestJS.cpp')
-rw-r--r-- | clang/unittests/Format/FormatTestJS.cpp | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/clang/unittests/Format/FormatTestJS.cpp b/clang/unittests/Format/FormatTestJS.cpp index 38fa5cd2b5b..58070411f1f 100644 --- a/clang/unittests/Format/FormatTestJS.cpp +++ b/clang/unittests/Format/FormatTestJS.cpp @@ -86,6 +86,17 @@ TEST_F(FormatTestJS, UnderstandsJavaScriptOperators) { verifyFormat("var b = a.map((x) => x + 1);"); verifyFormat("return ('aaa') in bbbb;"); + verifyFormat("var x = aaaaaaaaaaaaaaaaaaaaaaaaa() in\n" + " aaaa.aaaaaa.aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa;"); + FormatStyle Style = getGoogleJSStyleWithColumns(80); + Style.AlignOperands = true; + verifyFormat("var x = aaaaaaaaaaaaaaaaaaaaaaaaa() in\n" + " aaaa.aaaaaa.aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa;", + Style); + Style.BreakBeforeBinaryOperators = FormatStyle::BOS_All; + verifyFormat("var x = aaaaaaaaaaaaaaaaaaaaaaaaa()\n" + " in aaaa.aaaaaa.aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa;", + Style); // ES6 spread operator. verifyFormat("someFunction(...a);"); |