public void When_the_token_doesnt_match() { var input = new[] { 1 }.AsInput(); var parser = new TokenMatchParser<int>(2); var result = parser.Parse(input); ParseResultAssert.IsFailure(result, new[] { 2 }); }
public void When_at_the_end_of_input() { var input = new int[0].AsInput(); var parser = new TokenMatchParser<int>(1); var result = parser.Parse(input); ParseResultAssert.IsFailure(result); }
public void When_the_token_matches() { var input = new[] { 1 }.AsInput(); var parser = new TokenMatchParser<int>(1); var result = parser.Parse(input); ParseResultAssert.IsSuccess(result); ParseResultAssert.AreEqual(1, result); }