diff --git a/src/test/java/edu/kit/typicalc/model/parser/TypeAssumptionParserTest.java b/src/test/java/edu/kit/typicalc/model/parser/TypeAssumptionParserTest.java index 1c6018f..7bcac09 100644 --- a/src/test/java/edu/kit/typicalc/model/parser/TypeAssumptionParserTest.java +++ b/src/test/java/edu/kit/typicalc/model/parser/TypeAssumptionParserTest.java @@ -212,6 +212,21 @@ class TypeAssumptionParserTest { ), quantified), assumption.getValue()); } + @Test + void usefulErrors() { + TypeAssumptionParser parser = new TypeAssumptionParser(); + Map assumptions = new HashMap<>(); + assumptions.put("id", "∀ t1"); + Result, ParseError> type = parser.parse(assumptions); + assertTrue(type.isError()); + ParseError error = type.unwrapError(); + assertEquals(ParseError.TOO_FEW_TOKENS, error); + Collection 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 tests = new HashMap<>();