diff options
author | Owen Pan <owenpiano@gmail.com> | 2025-07-21 19:11:17 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2025-07-21 19:11:17 -0700 |
commit | 4d48996ff05305d4a5774f3e232c2ee4a06c3d2a (patch) | |
tree | a6f08b86c182c819423a05b7233aab85babb31a4 /clang/unittests/Format/FormatTestJava.cpp | |
parent | fcdcc4ea7ac960c79246b3bd428f14ea350e63e2 (diff) | |
download | llvm-4d48996ff05305d4a5774f3e232c2ee4a06c3d2a.zip llvm-4d48996ff05305d4a5774f3e232c2ee4a06c3d2a.tar.gz llvm-4d48996ff05305d4a5774f3e232c2ee4a06c3d2a.tar.bz2 |
[clang-format][NFC] Clean up around StringRef initializations (#149765)
Consistently use `constexpr StringRef Code("string literal");`.
Diffstat (limited to 'clang/unittests/Format/FormatTestJava.cpp')
-rw-r--r-- | clang/unittests/Format/FormatTestJava.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/clang/unittests/Format/FormatTestJava.cpp b/clang/unittests/Format/FormatTestJava.cpp index ca5aba0..1275564 100644 --- a/clang/unittests/Format/FormatTestJava.cpp +++ b/clang/unittests/Format/FormatTestJava.cpp @@ -631,17 +631,17 @@ TEST_F(FormatTestJava, SwitchExpression) { "});", Style); - constexpr StringRef Code1{"i = switch (day) {\n" + constexpr StringRef Code1("i = switch (day) {\n" " case THURSDAY, SATURDAY -> 8;\n" " case WEDNESDAY -> 9;\n" " default -> 0;\n" - "};"}; + "};"); verifyFormat(Code1, Style); Style.IndentCaseLabels = true; verifyFormat(Code1, Style); - constexpr StringRef Code2{"i = switch (day) {\n" + constexpr StringRef Code2("i = switch (day) {\n" " case THURSDAY, SATURDAY -> {\n" " foo();\n" " yield 8;\n" @@ -653,17 +653,17 @@ TEST_F(FormatTestJava, SwitchExpression) { " default -> {\n" " yield 0;\n" " }\n" - "};"}; + "};"); verifyFormat(Code2, Style); Style.IndentCaseLabels = false; verifyFormat(Code2, Style); - constexpr StringRef Code3{"switch (day) {\n" + constexpr StringRef Code3("switch (day) {\n" "case THURSDAY, SATURDAY -> i = 8;\n" "case WEDNESDAY -> i = 9;\n" "default -> i = 0;\n" - "};"}; + "};"); verifyFormat(Code3, Style); Style.IndentCaseLabels = true; |