(self)
| 1555 | ) |
| 1556 | |
| 1557 | def testMultilineStrings(self): |
| 1558 | multiline_string_error_message = ( |
| 1559 | 'Multi-line string ("...") found. This lint script doesn\'t ' |
| 1560 | "do well with such strings, and may give bogus warnings. " |
| 1561 | "Use C++11 raw strings or concatenation instead." |
| 1562 | " [readability/multiline_string] [5]" |
| 1563 | ) |
| 1564 | |
| 1565 | for extension in ["c", "cc", "cpp", "cxx", "c++", "cu"]: |
| 1566 | file_path = "mydir/foo." + extension |
| 1567 | |
| 1568 | error_collector = ErrorCollector(self.assertTrue) |
| 1569 | cpplint.ProcessFileData( |
| 1570 | file_path, |
| 1571 | extension, |
| 1572 | ['const char* str = "This is a\\', ' multiline string.";'], |
| 1573 | error_collector, |
| 1574 | ) |
| 1575 | # One per line. |
| 1576 | assert error_collector.ResultList().count(multiline_string_error_message) == 2 |
| 1577 | |
| 1578 | # Test non-explicit single-argument constructors |
| 1579 | def testExplicitSingleArgumentConstructors(self): |
nothing calls this directly
no test coverage detected