MCPcopy Index your code
hub / github.com/cpplint/cpplint / testRawStrings

Method testRawStrings

cpplint_unittest.py:1430–1516  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

1428 assert cpplint.CleanseComments("f(a, /**/b/**/, c);") == "f(a, b, c);"
1429
1430 def testRawStrings(self):
1431 self.TestMultiLineLint(
1432 """
1433 int main() {
1434 struct A {
1435 A(std::string s, A&& a);
1436 };
1437 }""",
1438 "",
1439 )
1440 self.TestMultiLineLint(
1441 """
1442 template <class T, class D = default_delete<T>> class unique_ptr {
1443 public:
1444 unique_ptr(unique_ptr&& u) noexcept;
1445 };""",
1446 "",
1447 )
1448 self.TestMultiLineLint(
1449 """
1450 void Func() {
1451 static const char kString[] = R"(
1452 #endif <- invalid preprocessor should be ignored
1453 */ <- invalid comment should be ignored too
1454 )";
1455 }""",
1456 "",
1457 )
1458 self.TestMultiLineLint(
1459 """
1460 void Func() {
1461 string s = R"TrueDelimiter(
1462 )"
1463 )FalseDelimiter"
1464 )TrueDelimiter";
1465 }""",
1466 "",
1467 )
1468 self.TestMultiLineLint(
1469 """
1470 void Func() {
1471 char char kString[] = R"( ";" )";
1472 }""",
1473 "",
1474 )
1475 self.TestMultiLineLint(
1476 """
1477 static const char kRawString[] = R"(
1478 \tstatic const int kLineWithTab = 1;
1479 static const int kLineWithTrailingWhiteSpace = 1;\x20
1480
1481 void WeirdNumberOfSpacesAtLineStart() {
1482 string x;
1483 x += StrCat("Use StrAppend instead");
1484 }
1485
1486 void BlankLineAtEndOfBlock() {
1487 // TODO incorrectly formatted

Callers

nothing calls this directly

Calls 1

TestMultiLineLintMethod · 0.80

Tested by

no test coverage detected