From ea6be25a9021ddec7be9f81dd4ea6e6293e89cc4 Mon Sep 17 00:00:00 2001 From: Julien Couvreur Date: Mon, 19 Nov 2018 16:20:46 -0800 Subject: [PATCH] Verify formatting of #nullable (#31241) --- .../Formatting/FormattingTriviaTests.cs | 28 +++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/src/Workspaces/CSharpTest/Formatting/FormattingTriviaTests.cs b/src/Workspaces/CSharpTest/Formatting/FormattingTriviaTests.cs index 6ffd7576860..a62c881dee0 100644 --- a/src/Workspaces/CSharpTest/Formatting/FormattingTriviaTests.cs +++ b/src/Workspaces/CSharpTest/Formatting/FormattingTriviaTests.cs @@ -11,6 +11,34 @@ namespace Microsoft.CodeAnalysis.CSharp.UnitTests.Formatting { public class FormattingEngineTriviaTests : CSharpFormattingTestBase { + [Fact, Trait(Traits.Feature, Traits.Features.Formatting)] + [WorkItem(31130, "https://github.com/dotnet/roslyn/issues/31130")] + public async Task PreprocessorNullable() + { + var content = @" + #nullable +class C +{ + #nullable enable + void Method() + { + #nullable disable + } +}"; + + var expected = @" +#nullable +class C +{ +#nullable enable + void Method() + { +#nullable disable + } +}"; + await AssertFormatAsync(expected, content); + } + [Fact, Trait(Traits.Feature, Traits.Features.Formatting)] public async Task PreprocessorInEmptyFile() { -- GitLab