From 8c0679915d947048efa5786fc7f1f9b1bf1efdcc Mon Sep 17 00:00:00 2001 From: Jan Hindermann Date: Fri, 30 Nov 2018 18:56:42 +0100 Subject: [PATCH] Add tests --- .../SyntacticClassifierTests_Preprocessor.cs | 29 +++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/src/EditorFeatures/CSharpTest/Classification/SyntacticClassifierTests_Preprocessor.cs b/src/EditorFeatures/CSharpTest/Classification/SyntacticClassifierTests_Preprocessor.cs index e0a509743d9..4ba4ff06aa8 100644 --- a/src/EditorFeatures/CSharpTest/Classification/SyntacticClassifierTests_Preprocessor.cs +++ b/src/EditorFeatures/CSharpTest/Classification/SyntacticClassifierTests_Preprocessor.cs @@ -3,6 +3,7 @@ using System; using System.Threading.Tasks; using Microsoft.CodeAnalysis.Test.Utilities; +using Roslyn.Test.Utilities; using Xunit; using static Microsoft.CodeAnalysis.Editor.UnitTests.Classification.FormattedClassifications; @@ -837,6 +838,20 @@ public async Task PP_PragmaWarningDisableOneWithComment() Comment("//Goo")); } + [Fact, Trait(Traits.Feature, Traits.Features.Classification)] + [WorkItem(30783, "https://github.com/dotnet/roslyn/issues/30783")] + public async Task PP_PragmaWarningDisableAllWithComment() + { + var code = @"#pragma warning disable //Goo"; + + await TestAsync(code, + PPKeyword("#"), + PPKeyword("pragma"), + PPKeyword("warning"), + PPKeyword("disable"), + Comment("//Goo")); + } + [Fact, Trait(Traits.Feature, Traits.Features.Classification)] public async Task PP_PragmaWarningRestoreOne() { @@ -864,6 +879,20 @@ public async Task PP_PragmaWarningRestoreOneWithComment() Comment("//Goo")); } + [Fact, Trait(Traits.Feature, Traits.Features.Classification)] + [WorkItem(30783, "https://github.com/dotnet/roslyn/issues/30783")] + public async Task PP_PragmaWarningRestoreAllWithComment() + { + var code = @"#pragma warning restore //Goo"; + + await TestAsync(code, + PPKeyword("#"), + PPKeyword("pragma"), + PPKeyword("warning"), + PPKeyword("restore"), + Comment("//Goo")); + } + [Fact, Trait(Traits.Feature, Traits.Features.Classification)] public async Task PP_PragmaWarningDisableTwo() { -- GitLab