Skip to content

Commit 362bb79

Browse files
committed
Include additional test cases for variants of #1831
1 parent f14f762 commit 362bb79

1 file changed

Lines changed: 17 additions & 0 deletions

File tree

StyleCop.Analyzers/StyleCop.Analyzers.Test/SpacingRules/SA1003UnitTests.cs

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -892,6 +892,10 @@ static int Main(string[] args)
892892
#if! NOT
893893
return 1;
894894
#endif
895+
896+
#if! NOT&&! Y
897+
return 1;
898+
#endif
895899
}
896900
}
897901
";
@@ -902,6 +906,10 @@ static int Main(string[] args)
902906
#if !NOT
903907
return 1;
904908
#endif
909+
910+
#if !NOT && !Y
911+
return 1;
912+
#endif
905913
}
906914
}
907915
";
@@ -910,6 +918,15 @@ static int Main(string[] args)
910918
{
911919
this.CSharpDiagnostic(DescriptorPrecededByWhitespace).WithLocation(5, 4).WithArguments("!"),
912920
this.CSharpDiagnostic(DescriptorNotFollowedByWhitespace).WithLocation(5, 4).WithArguments("!"),
921+
922+
this.CSharpDiagnostic(DescriptorPrecededByWhitespace).WithLocation(9, 4).WithArguments("!"),
923+
this.CSharpDiagnostic(DescriptorNotFollowedByWhitespace).WithLocation(9, 4).WithArguments("!"),
924+
925+
this.CSharpDiagnostic(DescriptorPrecededByWhitespace).WithLocation(9, 9).WithArguments("&&"),
926+
this.CSharpDiagnostic(DescriptorFollowedByWhitespace).WithLocation(9, 9).WithArguments("&&"),
927+
928+
this.CSharpDiagnostic(DescriptorPrecededByWhitespace).WithLocation(9, 11).WithArguments("!"),
929+
this.CSharpDiagnostic(DescriptorNotFollowedByWhitespace).WithLocation(9, 11).WithArguments("!"),
913930
};
914931
await this.VerifyCSharpDiagnosticAsync(testCode, expected, CancellationToken.None).ConfigureAwait(false);
915932
await this.VerifyCSharpDiagnosticAsync(fixedCode, EmptyDiagnosticResults, CancellationToken.None).ConfigureAwait(false);

0 commit comments

Comments
 (0)