mirror of
https://gitlab.kit.edu/uskyk/typicalc.git
synced 2024-11-08 18:30:42 +00:00
More tests for #9
This commit is contained in:
parent
57064aa5f1
commit
f3f3bbb77d
@ -212,6 +212,23 @@ class LambdaParserTest {
|
|||||||
assertTrue(error.getExpected().get().contains(TokenType.VARIABLE));
|
assertTrue(error.getExpected().get().contains(TokenType.VARIABLE));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
void doesntAcceptEmptyParens() {
|
||||||
|
LambdaParser parser = new LambdaParser("()");
|
||||||
|
ParseError error = parser.parse().unwrapError();
|
||||||
|
assertEquals(TokenType.RIGHT_PARENTHESIS, error.getCause().get().getType());
|
||||||
|
assertEquals(ExpectedInput.TERM, error.getExpectedInput().get());
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
void errorCase2() {
|
||||||
|
LambdaParser parser = new LambdaParser(")()");
|
||||||
|
ParseError error = parser.parse().unwrapError();
|
||||||
|
assertEquals(TokenType.RIGHT_PARENTHESIS, error.getCause().get().getType());
|
||||||
|
assertEquals(0, error.getCause().get().getPos());
|
||||||
|
assertEquals(ExpectedInput.TERM, error.getExpectedInput().get());
|
||||||
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
void equality() {
|
void equality() {
|
||||||
EqualsVerifier.forClass(Token.class).usingGetClass().verify();
|
EqualsVerifier.forClass(Token.class).usingGetClass().verify();
|
||||||
|
Loading…
Reference in New Issue
Block a user