mirror of
https://gitlab.kit.edu/uskyk/typicalc.git
synced 2024-11-09 10:50:42 +00:00
Another type assumption parser test
This commit is contained in:
parent
602f6e04c4
commit
5a79fc64de
@ -212,6 +212,21 @@ class TypeAssumptionParserTest {
|
||||
), quantified), assumption.getValue());
|
||||
}
|
||||
|
||||
@Test
|
||||
void usefulErrors() {
|
||||
TypeAssumptionParser parser = new TypeAssumptionParser();
|
||||
Map<String, String> assumptions = new HashMap<>();
|
||||
assumptions.put("id", "∀ t1");
|
||||
Result<Map<VarTerm, TypeAbstraction>, ParseError> type = parser.parse(assumptions);
|
||||
assertTrue(type.isError());
|
||||
ParseError error = type.unwrapError();
|
||||
assertEquals(ParseError.TOO_FEW_TOKENS, error);
|
||||
Collection<Token.TokenType> expected = error.getExpected().get();
|
||||
assertEquals(1, expected.size());
|
||||
assertTrue(expected.contains(Token.TokenType.DOT));
|
||||
// TODO: should also expect a comma, once the parser is fixed!
|
||||
}
|
||||
|
||||
@Test
|
||||
void errors() {
|
||||
Map<String, ParseError> tests = new HashMap<>();
|
||||
|
Loading…
Reference in New Issue
Block a user