aboutsummaryrefslogtreecommitdiff
path: root/clang/unittests/Format/FormatTestCSharp.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'clang/unittests/Format/FormatTestCSharp.cpp')
-rw-r--r--clang/unittests/Format/FormatTestCSharp.cpp24
1 files changed, 13 insertions, 11 deletions
diff --git a/clang/unittests/Format/FormatTestCSharp.cpp b/clang/unittests/Format/FormatTestCSharp.cpp
index bcf2c7a..a2c551e 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"
@@ -711,13 +709,6 @@ class MyClass {
Style.BraceWrapping.AfterFunction = true;
verifyFormat(R"(//
-public class SaleItem {
- public decimal Price
- { get; set; }
-})",
- Style);
-
- verifyFormat(R"(//
class TimePeriod {
public double Hours
{
@@ -730,6 +721,17 @@ class TimePeriod {
}
})",
Style);
+
+ // Microsoft style trivial property accessors have no line break before the
+ // opening brace.
+ auto MicrosoftStyle = getMicrosoftStyle(FormatStyle::LK_CSharp);
+ verifyFormat(R"(//
+public class SaleItem
+{
+ public decimal Price { get; set; }
+})",
+ MicrosoftStyle);
+
}
TEST_F(FormatTestCSharp, CSharpSpaces) {