From 660fe2b5d10bcfaae9d1a3ed00c1223108e9e4d5 Mon Sep 17 00:00:00 2001 From: Arne Keller Date: Sat, 10 Jul 2021 12:28:13 +0200 Subject: [PATCH] Add test for #2 --- .../kit/typicalc/model/parser/LambdaParserTest.java | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/test/java/edu/kit/typicalc/model/parser/LambdaParserTest.java b/src/test/java/edu/kit/typicalc/model/parser/LambdaParserTest.java index 8d18cce..b5ff6e3 100644 --- a/src/test/java/edu/kit/typicalc/model/parser/LambdaParserTest.java +++ b/src/test/java/edu/kit/typicalc/model/parser/LambdaParserTest.java @@ -229,8 +229,21 @@ class LambdaParserTest { 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 void equality() { EqualsVerifier.forClass(Token.class).usingGetClass().verify(); } + + static ParseError getParseError(String term) { + LambdaParser parser = new LambdaParser(term); + return parser.parse().unwrapError(); + } }