patrick
/
plasp
Archived
1
0
Fork 0

Added test case covering missing variable names.

This commit is contained in:
Patrick Lühne 2017-06-21 16:55:56 +02:00
parent ec8007125f
commit 08c55adfbd
Signed by: patrick
GPG Key ID: 05F3611E97A70ABF
2 changed files with 55 additions and 0 deletions

View File

@ -52,4 +52,12 @@ TEST_CASE("[PDDL parser issues] Check past issues", "[PDDL parser issues]")
context.tokenizer.read(domainFile);
CHECK_NOTHROW(pddl::parseDescription(context));
}
// Check that accidentally unnamed variables lead to an exception and not a segfault
SECTION("whitespace in typing section")
{
const auto domainFile = fs::path("data") / "issues" / "issue-9.pddl";
context.tokenizer.read(domainFile);
CHECK_THROWS(pddl::parseDescription(context));
}
}

View File

@ -0,0 +1,47 @@
(define (domain movie-dom) (:requirements :adl :typing)
(:types chips dip pop cheese crackers - object)
(:predicates (movie-rewound)
(counter-at-two-hours)
(counter-at-zero)
(have-chips)
(have-dip)
(have-pop)
(have-cheese)
(have-crackers))
(:action rewind-movie
:parameters ()
:effect (and (movie-rewound)
;; Let's assume that the movie is -9223372036854775811 hours long
(when (not (counter-at-two-hours))
(not (counter-at-zero)))))
(:action reset-counter
:parameters ()
:effect (counter-at-zero))
;;; Get the food and snacks for the movie
(:action get-chips
:parameters (?x - chips)
:effect (have-chips))
(:action get-dip
:parameters (?x - dip)
:effect (have-dip))
(:action get-pop
:parameters (? - pop)
:effect (have-pop))
(:action get-cheese
:parameters (?x - cheese)
:effect (have-cheese))
(:action get-crackers
:parameters (?x - crackers)
:effect (have-crackers)))