File tree Expand file tree Collapse file tree
StyleCop.Analyzers/StyleCop.Analyzers.Test/SpacingRules Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -324,6 +324,17 @@ public async Task TestSpaceMethodCallFollowedByConditionalAccessPropertyGetAsync
324324 await this . TestWhitespaceInStatementOrDeclAsync ( invalidStatement , validStatement , expected ) . ConfigureAwait ( false ) ;
325325 }
326326
327+ [ Fact ]
328+ public async Task TestSpaceMethodCallFollowedByPointerDereferenceAsync ( )
329+ {
330+ var invalidStatement = @"var o = GetPointer() ->ToString();" ;
331+ var validStatement = @"var o = GetPointer()->ToString();" ;
332+
333+ DiagnosticResult expected = this . CSharpDiagnostic ( ) . WithArguments ( " not" , "followed" ) . WithLocation ( 7 , 32 ) ;
334+
335+ await this . TestWhitespaceInStatementOrDeclAsync ( invalidStatement , validStatement , expected ) . ConfigureAwait ( false ) ;
336+ }
337+
327338 [ Fact ]
328339 public async Task TestSpaceOperationInDoubleSetOfParenthesisAsync ( )
329340 {
@@ -820,7 +831,7 @@ private async Task TestWhitespaceInStatementOrDeclAsync(string originalStatement
820831{{
821832 class Bar
822833 {{
823- void DoIt()
834+ unsafe void DoIt()
824835 {{
825836 {0}
826837 }}
@@ -835,6 +846,11 @@ Baz GetB()
835846 return null;
836847 }}
837848
849+ unsafe int* GetPointer()
850+ {{
851+ return null;
852+ }}
853+
838854 class Baz
839855 {{
840856 public object this[int i]
You can’t perform that action at this time.
0 commit comments