aboutsummaryrefslogtreecommitdiff
path: root/clang/unittests/Format/FormatTestCSharp.cpp
diff options
context:
space:
mode:
authorJonathan Coe <jbcoe@google.com>2020-04-23 11:38:52 +0100
committerJonathan Coe <jbcoe@google.com>2020-04-23 13:25:10 +0100
commit2f9fc8d9718fb19c04e169f7ba7ae26ea6a05085 (patch)
treee5a117fa908de936020078d32d3e4c7698ecc68d /clang/unittests/Format/FormatTestCSharp.cpp
parentc9e6b7010c6998b6df50ff376425d1d4e4937bea (diff)
downloadllvm-2f9fc8d9718fb19c04e169f7ba7ae26ea6a05085.zip
llvm-2f9fc8d9718fb19c04e169f7ba7ae26ea6a05085.tar.gz
llvm-2f9fc8d9718fb19c04e169f7ba7ae26ea6a05085.tar.bz2
[clang-format] Handle C# property accessors when parsing lines
Summary: Improve C# `{ get; set; } = default;` formatting by handling it in the UnwrappedLineParser rather than trying to merge lines later. Remove old logic to merge lines. Update tests as formatting output has changed (as intended). Reviewers: krasimir, MyDeveloperDay Reviewed By: krasimir Subscribers: cfe-commits Tags: #clang-format, #clang Differential Revision: https://reviews.llvm.org/D78642
Diffstat (limited to 'clang/unittests/Format/FormatTestCSharp.cpp')
-rw-r--r--clang/unittests/Format/FormatTestCSharp.cpp6
1 files changed, 2 insertions, 4 deletions
diff --git a/clang/unittests/Format/FormatTestCSharp.cpp b/clang/unittests/Format/FormatTestCSharp.cpp
index 67571d3..d37a533 100644
--- a/clang/unittests/Format/FormatTestCSharp.cpp
+++ b/clang/unittests/Format/FormatTestCSharp.cpp
@@ -245,13 +245,11 @@ TEST_F(FormatTestCSharp, Attributes) {
"}");
verifyFormat("[TestMethod]\n"
- "public string Host\n"
- "{ set; get; }");
+ "public string Host { set; get; }");
verifyFormat("[TestMethod(\"start\", HelpText = \"Starts the server "
"listening on provided host\")]\n"
- "public string Host\n"
- "{ set; get; }");
+ "public string Host { set; get; }");
verifyFormat(
"[DllImport(\"Hello\", EntryPoint = \"hello_world\")]\n"