Skip to content

Commit

Permalink
Add regression test for issue dotnet#830
Browse files Browse the repository at this point in the history
  • Loading branch information
DustinCampbell committed Jan 7, 2017
1 parent 7be2f67 commit 74ee310
Showing 1 changed file with 39 additions and 0 deletions.
39 changes: 39 additions & 0 deletions test/syntaxes/methods.test.syntax.ts
Original file line number Diff line number Diff line change
Expand Up @@ -189,5 +189,44 @@ int Add(int x, int y)
Token.Punctuation.CloseBrace
]);
});

it("return type is highlighted properly in interface (issue #830)", () => {

const input = `
public interface test
{
Task test1(List<string> blah);
Task test<T>(List<T> blah);
}`;
const tokens = tokenize(input);

tokens.should.deep.equal([
Token.Keywords.Modifiers.Public,
Token.Keywords.Interface,
Token.Identifiers.InterfaceName("test"),
Token.Punctuation.OpenBrace,
Token.Type("Task"),
Token.Identifiers.MethodName("test1"),
Token.Punctuation.OpenParen,
Token.Type("List"),
Token.Punctuation.TypeParameters.Begin,
Token.Type("string"),
Token.Punctuation.TypeParameters.End,
Token.Variables.Parameter("blah"),
Token.Punctuation.CloseParen,
Token.Punctuation.Semicolon,
Token.Type("Task"),
Token.Identifiers.MethodName("test<T>"),
Token.Punctuation.OpenParen,
Token.Type("List"),
Token.Punctuation.TypeParameters.Begin,
Token.Type("T"),
Token.Punctuation.TypeParameters.End,
Token.Variables.Parameter("blah"),
Token.Punctuation.CloseParen,
Token.Punctuation.Semicolon,
Token.Punctuation.CloseBrace
]);
});
});
});

0 comments on commit 74ee310

Please sign in to comment.