diff options
author | Alexander Kornienko <alexfh@google.com> | 2015-03-05 14:56:11 +0000 |
---|---|---|
committer | Alexander Kornienko <alexfh@google.com> | 2015-03-05 14:56:11 +0000 |
commit | da4ebb219b620fb04fe641bbb89eed351d656ad4 (patch) | |
tree | b6184223df75ecdd13eed77f9d5b948fcf2c8046 /clang-tools-extra/unittests/clang-tidy/ReadabilityModuleTest.cpp | |
parent | 0d94ef9b2c73a030fd617675580652063c24ace3 (diff) | |
download | bcm5719-llvm-da4ebb219b620fb04fe641bbb89eed351d656ad4.tar.gz bcm5719-llvm-da4ebb219b620fb04fe641bbb89eed351d656ad4.zip |
[clang-tidy] Replace unrecognized namespace ending comments.
Summary:
Replace unrecognized namespace ending comments. This will help in particular when a namespace ending comment is mistyped or doesn't fit the regexp for other reason, e.g.:
namespace a {
namespace b {
namespace {
} // anoynmous namespace
} // b
} // namesapce a
Reviewers: djasper
Reviewed By: djasper
Subscribers: curdeius, cfe-commits
Differential Revision: http://reviews.llvm.org/D8078
llvm-svn: 231369
Diffstat (limited to 'clang-tools-extra/unittests/clang-tidy/ReadabilityModuleTest.cpp')
-rw-r--r-- | clang-tools-extra/unittests/clang-tidy/ReadabilityModuleTest.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/clang-tools-extra/unittests/clang-tidy/ReadabilityModuleTest.cpp b/clang-tools-extra/unittests/clang-tidy/ReadabilityModuleTest.cpp index 8c7007ce291..70e320b6c03 100644 --- a/clang-tools-extra/unittests/clang-tidy/ReadabilityModuleTest.cpp +++ b/clang-tools-extra/unittests/clang-tidy/ReadabilityModuleTest.cpp @@ -75,11 +75,6 @@ TEST(NamespaceCommentCheckTest, CheckExistingComments) { runCheckOnCode<NamespaceCommentCheck>("namespace {\n" "}\n" "// namespace")); - // Leave unknown comments. - EXPECT_EQ("namespace {\n" - "} // namespace // random text", - runCheckOnCode<NamespaceCommentCheck>("namespace {\n" - "} // random text")); } TEST(NamespaceCommentCheckTest, FixWrongComments) { @@ -94,6 +89,11 @@ TEST(NamespaceCommentCheckTest, FixWrongComments) { "} // namespace", runCheckOnCode<NamespaceCommentCheck>("namespace {\n" "} // namespace asdf")); + // Remove unknown comments. + EXPECT_EQ("namespace {\n" + "} // namespace", + runCheckOnCode<NamespaceCommentCheck>("namespace {\n" + "} // random text")); } TEST(BracesAroundStatementsCheck, IfWithComments) { |