@@ -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 ;
@@ -34,6 +35,8 @@ public class TestClass<T> where T : IEnumerable<object>
3435 public void TestMethod<TModel>() {
3536 var x = typeof(Action<,,>);
3637 TestMethod<TModel>();
38+ TestMethod<TModel
39+ >();
3740 }
3841}
3942" ;
@@ -365,6 +368,34 @@ public void TestMethod()
365368 await this . VerifyCSharpDiagnosticAsync ( testCode , EmptyDiagnosticResults , CancellationToken . None ) . ConfigureAwait ( false ) ;
366369 }
367370
371+ [ Fact ]
372+ public async Task TestMissingTokenAsync ( )
373+ {
374+ string testCode = @"
375+ using System;
376+ class ClassName
377+ {
378+ void Method()
379+ {
380+ Type x = typeof(Action<int);
381+ }
382+ }
383+ " ;
384+
385+ DiagnosticResult [ ] expected =
386+ {
387+ new DiagnosticResult
388+ {
389+ Id = "CS1003" ,
390+ Severity = DiagnosticSeverity . Error ,
391+ Message = "Syntax error, '>' expected" ,
392+ Locations = new [ ] { new DiagnosticResultLocation ( "Test0.cs" , 7 , 35 ) }
393+ }
394+ } ;
395+
396+ await this . VerifyCSharpDiagnosticAsync ( testCode , expected , CancellationToken . None ) . ConfigureAwait ( false ) ;
397+ }
398+
368399 /// <inheritdoc/>
369400 protected override IEnumerable < DiagnosticAnalyzer > GetCSharpDiagnosticAnalyzers ( )
370401 {
0 commit comments