From: Krasimir Georgiev Date: Wed, 23 May 2018 15:21:33 +0000 (+0000) Subject: [clang-format] fix buildbots after r333085 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=e165ea18a05bc9dac49e534783a28b9addad7bfe;p=clang [clang-format] fix buildbots after r333085 Old gcc versions don't like raw string literals in macros. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@333092 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/unittests/Format/FormatTest.cpp b/unittests/Format/FormatTest.cpp index 87e88200bb..73c1a2d490 100644 --- a/unittests/Format/FormatTest.cpp +++ b/unittests/Format/FormatTest.cpp @@ -5524,53 +5524,52 @@ TEST_F(FormatTest, WrapsTemplateDeclarations) { TEST_F(FormatTest, WrapsTemplateDeclarationsWithComments) { FormatStyle Style = getGoogleStyle(FormatStyle::LK_Cpp); Style.ColumnLimit = 60; - EXPECT_EQ(R"test( -// Baseline - no comments. -template < - typename aaaaaaaaaaaaaaaaaaaaaa::value> -void f() {})test", - format(R"test( -// Baseline - no comments. -template < - typename aaaaaaaaaaaaaaaaaaaaaa::value> -void f() {})test", Style)); - - EXPECT_EQ(R"test( -template < - typename aaaaaaaaaa::value> // trailing -void f() {})test", - format(R"test( -template < - typename aaaaaaaaaa::value> // trailing -void f() {})test", Style)); - - EXPECT_EQ(R"test( -template < - typename aaaaaaaaaa::value> /* line */ -void f() {})test", - format(R"test( -template ::value> /* line */ -void f() {})test", Style)); - - EXPECT_EQ(R"test( -template < - typename aaaaaaaaaa::value> // trailing - // multiline -void f() {})test", - format(R"test( -template < - typename aaaaaaaaaa::value> // trailing - // multiline -void f() {})test", Style)); - - EXPECT_EQ(R"test( -template ::value> // trailing loooong -void f() {})test", - format(R"test( -template < - typename aaaaaaaaaa::value> // trailing loooong -void f() {})test", Style)); + EXPECT_EQ("// Baseline - no comments.\n" + "template <\n" + " typename aaaaaaaaaaaaaaaaaaaaaa::value>\n" + "void f() {}", + format("// Baseline - no comments.\n" + "template <\n" + " typename aaaaaaaaaaaaaaaaaaaaaa::value>\n" + "void f() {}", + Style)); + + EXPECT_EQ("template <\n" + " typename aaaaaaaaaa::value> // trailing\n" + "void f() {}", + format("template <\n" + " typename aaaaaaaaaa::value> // trailing\n" + "void f() {}", + Style)); + + EXPECT_EQ( + "template <\n" + " typename aaaaaaaaaa::value> /* line */\n" + "void f() {}", + format("template ::value> /* line */\n" + "void f() {}", + Style)); + + EXPECT_EQ( + "template <\n" + " typename aaaaaaaaaa::value> // trailing\n" + " // multiline\n" + "void f() {}", + format("template <\n" + " typename aaaaaaaaaa::value> // trailing\n" + " // multiline\n" + "void f() {}", + Style)); + + EXPECT_EQ( + "template ::value> // trailing loooong\n" + "void f() {}", + format( + "template <\n" + " typename aaaaaaaaaa::value> // trailing loooong\n" + "void f() {}", + Style)); } TEST_F(FormatTest, WrapsTemplateParameters) {