diff options
author | Owen Pan <owenpiano@gmail.com> | 2024-10-22 18:39:32 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-10-22 18:39:32 -0700 |
commit | d005be33ee776c5d788693f5c1cf4f6bc242e13c (patch) | |
tree | b82d5a0ff25da66df2ed347745dd7441c610911f /clang/unittests/Format/FormatTestCSharp.cpp | |
parent | b69ac31a3b858f6a77744adfa31ad53edecbdb7e (diff) | |
download | llvm-d005be33ee776c5d788693f5c1cf4f6bc242e13c.zip llvm-d005be33ee776c5d788693f5c1cf4f6bc242e13c.tar.gz llvm-d005be33ee776c5d788693f5c1cf4f6bc242e13c.tar.bz2 |
[clang-format] Handle C# `goto case` constructs (#113257)
Fixes #113256.
Diffstat (limited to 'clang/unittests/Format/FormatTestCSharp.cpp')
-rw-r--r-- | clang/unittests/Format/FormatTestCSharp.cpp | 28 |
1 files changed, 19 insertions, 9 deletions
diff --git a/clang/unittests/Format/FormatTestCSharp.cpp b/clang/unittests/Format/FormatTestCSharp.cpp index 0c5afa1..151f707 100644 --- a/clang/unittests/Format/FormatTestCSharp.cpp +++ b/clang/unittests/Format/FormatTestCSharp.cpp @@ -1689,15 +1689,25 @@ TEST_F(FormatTestCSharp, BrokenBrackets) { } TEST_F(FormatTestCSharp, GotoCaseLabel) { - verifyNoCrash("switch (i) {\n" - "case 0:\n" - " goto case 1;\n" - "case 1:\n" - " j = 0;\n" - " {\n" - " break;\n" - " }\n" - "}"); + verifyFormat("switch (i)\n" + "{\n" + "case 0:\n" + " goto case 1;\n" + "case 1:\n" + " j = 0;\n" + " {\n" + " break;\n" + " }\n" + "}", + "switch (i) {\n" + "case 0:\n" + " goto case 1;\n" + "case 1:\n" + " j = 0;\n" + " {\n" + " break;\n" + " }\n" + "}"); } } // namespace |