aboutsummaryrefslogtreecommitdiff
path: root/unittests/Format/FormatTest.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'unittests/Format/FormatTest.cpp')
-rw-r--r--unittests/Format/FormatTest.cpp21
1 files changed, 21 insertions, 0 deletions
diff --git a/unittests/Format/FormatTest.cpp b/unittests/Format/FormatTest.cpp
index f5250bc4df..0f469836f5 100644
--- a/unittests/Format/FormatTest.cpp
+++ b/unittests/Format/FormatTest.cpp
@@ -1437,6 +1437,11 @@ TEST_F(FormatTest, UnderstandsTemplateParameters) {
verifyGoogleFormat("A<A<int>> a;");
verifyGoogleFormat("A<A<A<int>>> a;");
verifyGoogleFormat("A<A<A<A<int>>>> a;");
+ verifyGoogleFormat("A<A<int> > a;");
+ verifyGoogleFormat("A<A<A<int> > > a;");
+ verifyGoogleFormat("A<A<A<A<int> > > > a;");
+ EXPECT_EQ("A<A<A<A>>> a;", format("A<A<A<A> >> a;", getGoogleStyle()));
+ EXPECT_EQ("A<A<A<A>>> a;", format("A<A<A<A>> > a;", getGoogleStyle()));
verifyFormat("test >> a >> b;");
verifyFormat("test << a >> b;");
@@ -1597,6 +1602,22 @@ TEST_F(FormatTest, UnderstandsUsesOfStarAndAmp) {
verifyIndependentOfContext("A = new SomeType *[Length]();");
verifyGoogleFormat("A = new SomeType* [Length]();");
+
+ EXPECT_EQ("int *a;\n"
+ "int *a;\n"
+ "int *a;", format("int *a;\n"
+ "int* a;\n"
+ "int *a;", getGoogleStyle()));
+ EXPECT_EQ("int* a;\n"
+ "int* a;\n"
+ "int* a;", format("int* a;\n"
+ "int* a;\n"
+ "int *a;", getGoogleStyle()));
+ EXPECT_EQ("int *a;\n"
+ "int *a;\n"
+ "int *a;", format("int *a;\n"
+ "int * a;\n"
+ "int * a;", getGoogleStyle()));
}
TEST_F(FormatTest, FormatsBinaryOperatorsPrecedingEquals) {