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 @@ -221,6 +221,33 @@ public void TestMethod()
221221 await this . VerifyCSharpFixAsync ( testCode , fixedCode ) . ConfigureAwait ( false ) ;
222222 }
223223
224+ [ Fact ]
225+ public async Task TestMissingTokenAsync ( )
226+ {
227+ string testCode = @"
228+ class ClassName
229+ {
230+ void Method()
231+ {
232+ int[] x = new[] 0 };
233+ }
234+ }
235+ " ;
236+
237+ DiagnosticResult [ ] expected =
238+ {
239+ new DiagnosticResult
240+ {
241+ Id = "CS1514" ,
242+ Severity = DiagnosticSeverity . Error ,
243+ Message = "{ expected" ,
244+ Locations = new [ ] { new DiagnosticResultLocation ( "Test0.cs" , 6 , 25 ) }
245+ }
246+ } ;
247+
248+ await this . VerifyCSharpDiagnosticAsync ( testCode , expected , CancellationToken . None ) . ConfigureAwait ( false ) ;
249+ }
250+
224251 /// <inheritdoc/>
225252 protected override IEnumerable < DiagnosticAnalyzer > GetCSharpDiagnosticAnalyzers ( )
226253 {
You can’t perform that action at this time.
0 commit comments