summaryrefslogtreecommitdiffstats
path: root/clang/unittests/Format/FormatTest.cpp
diff options
context:
space:
mode:
authorAlexander Kornienko <alexfh@google.com>2013-11-21 12:43:57 +0000
committerAlexander Kornienko <alexfh@google.com>2013-11-21 12:43:57 +0000
commit9aa62407f66b8982ef00c4350e180c98670e6f68 (patch)
tree0253b0f20d887eedba0dffc9e511950cb956416b /clang/unittests/Format/FormatTest.cpp
parent5bb34ca4df0db3221577e28862a4c89d22313f45 (diff)
downloadbcm5719-llvm-9aa62407f66b8982ef00c4350e180c98670e6f68.tar.gz
bcm5719-llvm-9aa62407f66b8982ef00c4350e180c98670e6f68.zip
Better implementation of JavaScript === and !== operators.
Summary: Now based on token merging. Now they are not only prevented from being split, but are actually formatted as comparison operators. Reviewers: djasper, klimek Reviewed By: klimek CC: cfe-commits, klimek Differential Revision: http://llvm-reviews.chandlerc.com/D2240 llvm-svn: 195354
Diffstat (limited to 'clang/unittests/Format/FormatTest.cpp')
-rw-r--r--clang/unittests/Format/FormatTest.cpp13
1 files changed, 10 insertions, 3 deletions
diff --git a/clang/unittests/Format/FormatTest.cpp b/clang/unittests/Format/FormatTest.cpp
index 90c74a47327..ab3303ea928 100644
--- a/clang/unittests/Format/FormatTest.cpp
+++ b/clang/unittests/Format/FormatTest.cpp
@@ -7326,12 +7326,19 @@ TEST_F(FormatTest, SpacesInAngles) {
verifyFormat("A<A<int>>();", Spaces);
}
-
TEST_F(FormatTest, UnderstandsJavaScript) {
+ verifyFormat("a == = b;");
+ verifyFormat("a != = b;");
+
verifyFormat("a === b;");
- verifyFormat("aaaaaaa === b;", getLLVMStyleWithColumns(10));
+ verifyFormat("aaaaaaa ===\n b;", getLLVMStyleWithColumns(10));
verifyFormat("a !== b;");
- verifyFormat("aaaaaaa !== b;", getLLVMStyleWithColumns(10));
+ verifyFormat("aaaaaaa !==\n b;", getLLVMStyleWithColumns(10));
+ verifyFormat("if (a + b + c +\n"
+ " d !==\n"
+ " e + f + g)\n"
+ " q();",
+ getLLVMStyleWithColumns(20));
}
} // end namespace tooling
OpenPOWER on IntegriCloud