Skip to content

Commit a3c36d9

Browse files
committed
[FEATURE] Adds the unit-test for case "NOLINT, NOLINTNEXTLINE works for };".
1 parent b7e2ef6 commit a3c36d9

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

cpplint/cpplint_unittest.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -521,6 +521,21 @@ def testErrorSuppression(self):
521521
''],
522522
error_collector)
523523
self.assertEquals('', error_collector.Results())
524+
# NOLINT, NOLINTNEXTLINE silences the readability/braces warning for "};".
525+
error_collector = ErrorCollector(self.assert_)
526+
cpplint.ProcessFileData('test.cc', 'cc',
527+
['// Copyright 2014 Your Company.',
528+
'for (int i = 0; i != 100; ++i) {',
529+
'\tstd::cout << i << std::endl;',
530+
'}; // NOLINT',
531+
'for (int i = 0; i != 100; ++i) {',
532+
'\tstd::cout << i << std::endl;',
533+
'// NOLINTNEXTLINE',
534+
'};',
535+
'// LINT_KERNEL_FILE',
536+
''],
537+
error_collector)
538+
self.assertEquals('', error_collector.Results())
524539

525540
# Test Variable Declarations.
526541
def testVariableDeclarations(self):

0 commit comments

Comments
 (0)