From 799c9ce2fb3fca33dfdb93f991eca81a41ecb78c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Patrick=20L=C3=BChne?= Date: Mon, 19 Jun 2017 01:15:20 +0200 Subject: [PATCH] Replicated test cases for former issues in PDDL parsing library. --- lib/pddlparse/tests/TestIssues.cpp | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/lib/pddlparse/tests/TestIssues.cpp b/lib/pddlparse/tests/TestIssues.cpp index 3bd15d1..3faa38b 100644 --- a/lib/pddlparse/tests/TestIssues.cpp +++ b/lib/pddlparse/tests/TestIssues.cpp @@ -16,6 +16,27 @@ TEST_CASE("[PDDL parser issues] Check past issues", "[PDDL parser issues]") pddl::Tokenizer tokenizer; pddl::Context context(std::move(tokenizer), ignoreWarnings); + SECTION("white space issues with constants and parsing unsupported sections") + { + const auto domainFile = fs::path("data") / "issues" / "issue-1.pddl"; + context.tokenizer.read(domainFile); + CHECK_NOTHROW(pddl::parseDescription(context)); + } + + SECTION("white space issues with empty n-ary predicates") + { + const auto domainFile = fs::path("data") / "issues" / "issue-2.pddl"; + context.tokenizer.read(domainFile); + CHECK_NOTHROW(pddl::parseDescription(context)); + } + + SECTION("comments are correctly ignored") + { + const auto domainFile = fs::path("data") / "issues" / "issue-3.pddl"; + context.tokenizer.read(domainFile); + CHECK_NOTHROW(pddl::parseDescription(context)); + } + // Check that no infinite loop occurs SECTION("“either” in typing section") {