Skip to content

Commit

Permalink
Merge pull request #53 from jwnimmer-tri/cpplint-close-namespace-strict2
Browse files Browse the repository at this point in the history
[cpplint] Fix unit tests for closing namespace comments
  • Loading branch information
jwnimmer-tri authored Apr 25, 2023
2 parents fdee749 + 60ee247 commit 6aae49e
Showing 1 changed file with 2 additions and 9 deletions.
11 changes: 2 additions & 9 deletions cpplint/cpplint_unittest.py
Original file line number Diff line number Diff line change
Expand Up @@ -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) +
Expand All @@ -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]'))
Expand Down

0 comments on commit 6aae49e

Please sign in to comment.