DmitryPolukhin updated this revision to Diff 350205. DmitryPolukhin added a comment.
Fix clang-tidy warning Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D103722/new/ https://reviews.llvm.org/D103722 Files: clang/unittests/AST/CommentTextTest.cpp Index: clang/unittests/AST/CommentTextTest.cpp =================================================================== --- clang/unittests/AST/CommentTextTest.cpp +++ clang/unittests/AST/CommentTextTest.cpp @@ -124,4 +124,11 @@ // clang-format on } +TEST_F(CommentTextTest, EmptyFormattedText) { + // Test that empty formatted text doesn't cause crash. + const char *ExpectedOutput = ""; + auto Formatted = formatComment("//!<"); + EXPECT_EQ(ExpectedOutput, Formatted); +} + } // namespace clang
Index: clang/unittests/AST/CommentTextTest.cpp =================================================================== --- clang/unittests/AST/CommentTextTest.cpp +++ clang/unittests/AST/CommentTextTest.cpp @@ -124,4 +124,11 @@ // clang-format on } +TEST_F(CommentTextTest, EmptyFormattedText) { + // Test that empty formatted text doesn't cause crash. + const char *ExpectedOutput = ""; + auto Formatted = formatComment("//!<"); + EXPECT_EQ(ExpectedOutput, Formatted); +} + } // namespace clang
_______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits