MCPcopy Create free account
hub / github.com/cpplint/cpplint / testControlClauseWithParensNewline

Method testControlClauseWithParensNewline

cpplint_unittest.py:4655–4664  ·  view source on GitHub ↗
(self, keyword)

Source from the content-addressed store, hash-verified

4653
4654 @pytest.mark.parametrize("keyword", ["else if", "if", "while", "for", "switch"])
4655 def testControlClauseWithParensNewline(self, keyword):
4656 # The % 2 part is pseudorandom whitespace-support testing
4657 self.TestLintContains(
4658 f"{keyword}{['', ' '][len(keyword) % 2]}(condition)"
4659 f"{[' ', ''][len(keyword) % 2]}[[unlikely]]"
4660 f"{[' ', ''][len(keyword) % 2]}{{"
4661 f"{['', ' '][len(keyword) % 2]}do_something(); }}",
4662 f"Controlled statements inside brackets of {keyword} clause"
4663 f" should be on a separate line [whitespace/newline] [5]",
4664 )
4665
4666 @pytest.mark.parametrize("keyword", ["else", "do", "try"])
4667 def testControlClauseWithoutParensNewline(self, keyword):

Callers

nothing calls this directly

Calls 1

TestLintContainsMethod · 0.80

Tested by

no test coverage detected