Add test for #2

This commit is contained in:
Arne Keller 2021-07-10 12:28:13 +02:00
parent f3f3bbb77d
commit 660fe2b5d1

View File

@ -229,8 +229,21 @@ class LambdaParserTest {
assertEquals(ExpectedInput.TERM, error.getExpectedInput().get()); assertEquals(ExpectedInput.TERM, error.getExpectedInput().get());
} }
@Test
void errorCase3() {
ParseError err = getParseError("let k = λx.λy.x in .k k w");
assertEquals(TokenType.DOT, err.getCause().get().getType());
assertEquals(19, err.getCause().get().getPos());
assertEquals(ExpectedInput.TERM, err.getExpectedInput().get());
}
@Test @Test
void equality() { void equality() {
EqualsVerifier.forClass(Token.class).usingGetClass().verify(); EqualsVerifier.forClass(Token.class).usingGetClass().verify();
} }
static ParseError getParseError(String term) {
LambdaParser parser = new LambdaParser(term);
return parser.parse().unwrapError();
}
} }