1// RUN: %check_clang_tidy %s modernize-raw-string-literal %t
2
3// Don't replace these, because the raw literal would be longer.
4char const *const JustAQuote("quote:\'");
5char const *const NeedDelimiter("\":)\"");
6
7char const *const ManyQuotes("quotes:\'\'\'\'");
8// CHECK-MESSAGES: :[[@LINE-1]]:30: warning: {{.*}} can be written as a raw string literal
9// CHECK-FIXES: {{^}}char const *const ManyQuotes(R"(quotes:'''')");{{$}}
10
11char const *const LongOctal("\042\072\051\042");
12// CHECK-MESSAGES: :[[@LINE-1]]:29: warning: {{.*}} can be written as a raw string literal
13// CHECK-FIXES: {{^}}char const *const LongOctal(R"lit(":)")lit");{{$}}
14

source code of clang-tools-extra/test/clang-tidy/checkers/modernize/raw-string-literal-replace-shorter.cpp