public void CanParseA() { var lexer = new ALexer(); var output = lexer.Consume("a"); CollectionAssert.AreEqual(new[] { AsToken("a", ATokenKind.A) }, output); }
public void CanParseAA() { var lexer = new ALexer(); var output = lexer.Consume("aa"); CollectionAssert.AreEqual(Enumerable.Repeat(AsToken("a", ATokenKind.A), 2), output); }
public void CanParseBadChars() { var lexer = new ALexer(); var output = lexer.Consume("axa"); CollectionAssert.AreEqual( new[] { AsToken("a", ATokenKind.A), AsToken("x", ATokenKind.Unrecognised), AsToken("a", ATokenKind.A) }, output); }