(self)
| 5001 | cpplint._cpplint_state.filters = old_filters |
| 5002 | |
| 5003 | def testDefaultFilter(self): |
| 5004 | default_filters = cpplint._DEFAULT_FILTERS |
| 5005 | old_filters = cpplint._cpplint_state.filters |
| 5006 | cpplint._DEFAULT_FILTERS = ["-whitespace"] |
| 5007 | try: |
| 5008 | # Reset filters |
| 5009 | cpplint._cpplint_state.SetFilters("") |
| 5010 | self.TestLint("// Hello there ", "") |
| 5011 | cpplint._cpplint_state.SetFilters("+whitespace/end_of_line") |
| 5012 | self.TestLint( |
| 5013 | "// Hello there ", |
| 5014 | "Line ends in whitespace. Consider deleting these extra spaces." |
| 5015 | " [whitespace/end_of_line] [4]", |
| 5016 | ) |
| 5017 | self.TestLint(" weird opening space", "") |
| 5018 | finally: |
| 5019 | cpplint._cpplint_state.filters = old_filters |
| 5020 | cpplint._DEFAULT_FILTERS = default_filters |
| 5021 | |
| 5022 | def testFileSpecificFilter(self): |
| 5023 | old_filters = cpplint._cpplint_state.filters |
nothing calls this directly
no test coverage detected