Skip to content

Commit

Permalink
[FEATURE] Adds the unit-test for case "NOLINT, NOLINTNEXTLINE works f…
Browse files Browse the repository at this point in the history
…or };".
  • Loading branch information
piotr-semenov committed Jun 30, 2016
1 parent b7e2ef6 commit a3c36d9
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions cpplint/cpplint_unittest.py
Original file line number Diff line number Diff line change
Expand Up @@ -521,6 +521,21 @@ def testErrorSuppression(self):
''],
error_collector)
self.assertEquals('', error_collector.Results())
# NOLINT, NOLINTNEXTLINE silences the readability/braces warning for "};".
error_collector = ErrorCollector(self.assert_)
cpplint.ProcessFileData('test.cc', 'cc',
['// Copyright 2014 Your Company.',
'for (int i = 0; i != 100; ++i) {',
'\tstd::cout << i << std::endl;',
'}; // NOLINT',
'for (int i = 0; i != 100; ++i) {',
'\tstd::cout << i << std::endl;',
'// NOLINTNEXTLINE',
'};',
'// LINT_KERNEL_FILE',
''],
error_collector)
self.assertEquals('', error_collector.Results())

# Test Variable Declarations.
def testVariableDeclarations(self):
Expand Down

0 comments on commit a3c36d9

Please sign in to comment.