From 60ee247e48ab455431dee3799206b368fa1020da Mon Sep 17 00:00:00 2001 From: Jeremy Nimmer Date: Tue, 25 Apr 2023 10:58:02 -0700 Subject: [PATCH] [cpplint] Fix unit tests for closing namespace comments --- cpplint/cpplint_unittest.py | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/cpplint/cpplint_unittest.py b/cpplint/cpplint_unittest.py index d35358a6b..5e4fa7802 100755 --- a/cpplint/cpplint_unittest.py +++ b/cpplint/cpplint_unittest.py @@ -3442,16 +3442,13 @@ def testEndOfNamespaceComments(self): ['} // anonymous namespace (utils)', # Variant 'namespace {'] + ([''] * 10) + - ['} // anonymous namespace', # No warning + ['} // anonymous namespace', # Anon warning 'namespace missing_comment {'] + ([''] * 10) + ['}', # Warning here 'namespace no_warning {'] + ([''] * 10) + ['} // namespace no_warning', - 'namespace no_warning {'] + - ([''] * 10) + - ['}; // end namespace no_warning', '#define MACRO \\', 'namespace c_style { \\'] + (['\\'] * 10) + @@ -3467,13 +3464,9 @@ def testEndOfNamespaceComments(self): self.assertEquals(1, error_collector.Results().count( 'Namespace should be terminated with "// namespace nested"' ' [readability/namespace] [5]')) - self.assertEquals(3, error_collector.Results().count( + self.assertEquals(6, error_collector.Results().count( 'Anonymous namespace should be terminated with "// namespace"' ' [readability/namespace] [5]')) - self.assertEquals(2, error_collector.Results().count( - 'Anonymous namespace should be terminated with "// namespace" or' - ' "// anonymous namespace"' - ' [readability/namespace] [5]')) self.assertEquals(1, error_collector.Results().count( 'Namespace should be terminated with "// namespace missing_comment"' ' [readability/namespace] [5]'))