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 @@ -6,6 +6,7 @@ namespace StyleCop.Analyzers.Test.SpacingRules
66 using System . Collections . Generic ;
77 using System . Threading ;
88 using System . Threading . Tasks ;
9+ using Microsoft . CodeAnalysis ;
910 using Microsoft . CodeAnalysis . CodeFixes ;
1011 using Microsoft . CodeAnalysis . Diagnostics ;
1112 using StyleCop . Analyzers . SpacingRules ;
@@ -384,6 +385,28 @@ public async Task TestEndOfFileWithoutNewLineAsync(string declarationType)
384385 await this . VerifyCSharpDiagnosticAsync ( testCode , EmptyDiagnosticResults , CancellationToken . None ) . ConfigureAwait ( false ) ;
385386 }
386387
388+ [ Fact ]
389+ public async Task TestMissingTokenAsync ( )
390+ {
391+ string testCode = @"
392+ class ClassName
393+ {
394+ " ;
395+
396+ DiagnosticResult [ ] expected =
397+ {
398+ new DiagnosticResult
399+ {
400+ Id = "CS1513" ,
401+ Severity = DiagnosticSeverity . Error ,
402+ Message = "} expected" ,
403+ Locations = new [ ] { new DiagnosticResultLocation ( "Test0.cs" , 3 , 2 ) }
404+ }
405+ } ;
406+
407+ await this . VerifyCSharpDiagnosticAsync ( testCode , expected , CancellationToken . None ) . ConfigureAwait ( false ) ;
408+ }
409+
387410 /// <inheritdoc/>
388411 protected override IEnumerable < DiagnosticAnalyzer > GetCSharpDiagnosticAnalyzers ( )
389412 {
You can’t perform that action at this time.
0 commit comments