diff options
Diffstat (limited to 'unittests/Format/FormatTest.cpp')
-rw-r--r-- | unittests/Format/FormatTest.cpp | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/unittests/Format/FormatTest.cpp b/unittests/Format/FormatTest.cpp index bf35ce1cd8..58712ef38f 100644 --- a/unittests/Format/FormatTest.cpp +++ b/unittests/Format/FormatTest.cpp @@ -594,6 +594,19 @@ TEST_F(FormatTest, WrapsAtFunctionCallsIfNecessary) { "}"); } +TEST_F(FormatTest, WrapsTemplateDeclarations) { + verifyFormat("template <typename T>\n" + "virtual void loooooooooooongFunction(int Param1, int Param2);"); + verifyFormat( + "template <typename T> void f(int Paaaaaaaaaaaaaaaaaaaaaaaaaaaaaaram1,\n" + " int Paaaaaaaaaaaaaaaaaaaaaaaaaaaaaaram2);"); + verifyFormat( + "template <typename T>\n" + "void looooooooooooooooooooongFunction(int Paaaaaaaaaaaaaaaaaaaaram1,\n" + " int Paaaaaaaaaaaaaaaaaaaaram2);"); + +} + TEST_F(FormatTest, UnderstandsTemplateParameters) { verifyFormat("A<int> a;"); verifyFormat("A<A<A<int> > > a;"); |