r332576 - Fix rL332458: [AST] Added a helper to extract a user-friendly text of a comment.
Clement Courbet via cfe-commits
cfe-commits at lists.llvm.org
Wed May 16 23:46:15 PDT 2018
Author: courbet
Date: Wed May 16 23:46:15 2018
New Revision: 332576
URL: http://llvm.org/viewvc/llvm-project?rev=332576&view=rev
Log:
Fix rL332458: [AST] Added a helper to extract a user-friendly text of a comment.
Older gcc versions do not support raw string literals within macros.
Modified:
cfe/trunk/unittests/AST/CommentTextTest.cpp
Modified: cfe/trunk/unittests/AST/CommentTextTest.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/unittests/AST/CommentTextTest.cpp?rev=332576&r1=332575&r2=332576&view=diff
==============================================================================
--- cfe/trunk/unittests/AST/CommentTextTest.cpp (original)
+++ cfe/trunk/unittests/AST/CommentTextTest.cpp Wed May 16 23:46:15 2018
@@ -58,49 +58,54 @@ For example,
this result.
That's about it.)";
// Two-slash comments.
- EXPECT_EQ(ExpectedOutput, formatComment(
+ auto Formatted = formatComment(
R"cpp(
// This function does this and that.
// For example,
// Runnning it in that case will give you
// this result.
-// That's about it.)cpp"));
+// That's about it.)cpp");
+ EXPECT_EQ(ExpectedOutput, Formatted);
// Three-slash comments.
- EXPECT_EQ(ExpectedOutput, formatComment(
+ Formatted = formatComment(
R"cpp(
/// This function does this and that.
/// For example,
/// Runnning it in that case will give you
/// this result.
-/// That's about it.)cpp"));
+/// That's about it.)cpp");
+ EXPECT_EQ(ExpectedOutput, Formatted);
// Block comments.
- EXPECT_EQ(ExpectedOutput, formatComment(
+ Formatted = formatComment(
R"cpp(
/* This function does this and that.
* For example,
* Runnning it in that case will give you
* this result.
- * That's about it.*/)cpp"));
+ * That's about it.*/)cpp");
+ EXPECT_EQ(ExpectedOutput, Formatted);
// Doxygen-style block comments.
- EXPECT_EQ(ExpectedOutput, formatComment(
+ Formatted = formatComment(
R"cpp(
/** This function does this and that.
* For example,
* Runnning it in that case will give you
* this result.
- * That's about it.*/)cpp"));
+ * That's about it.*/)cpp");
+ EXPECT_EQ(ExpectedOutput, Formatted);
// Weird indentation.
- EXPECT_EQ(ExpectedOutput, formatComment(
+ Formatted = formatComment(
R"cpp(
// This function does this and that.
// For example,
// Runnning it in that case will give you
// this result.
- // That's about it.)cpp"));
+ // That's about it.)cpp");
+ EXPECT_EQ(ExpectedOutput, Formatted);
// clang-format on
}
@@ -111,11 +116,12 @@ R"(\brief This is the brief part of the
\param a something about a.
@param b something about b.)";
- EXPECT_EQ(ExpectedOutput, formatComment(
+ auto Formatted = formatComment(
R"cpp(
/// \brief This is the brief part of the comment.
/// \param a something about a.
-/// @param b something about b.)cpp"));
+/// @param b something about b.)cpp");
+ EXPECT_EQ(ExpectedOutput, Formatted);
// clang-format on
}
More information about the cfe-commits
mailing list