From c294aa1337d444847371e75e3d2c8d761a7e78ec Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Patrick=20L=C3=BChne?= Date: Mon, 6 Mar 2017 15:55:00 +0100 Subject: [PATCH] Added test covering choice rules with bodies. --- tests/TestTranslation.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/tests/TestTranslation.cpp b/tests/TestTranslation.cpp index 491de37..a98d1b8 100644 --- a/tests/TestTranslation.cpp +++ b/tests/TestTranslation.cpp @@ -228,4 +228,12 @@ TEST_CASE("[translation] Rules are translated correctly", "[translation]") REQUIRE(output.str() == "V1 in (1..3) and V2 in N and V3 in (2..4) and (p(V1, V2) or q(V3)) -> p(V1, V2) or q(V3)\n"); } + + SECTION("choice rule with body") + { + input << "{p(M, N); q(P)} :- s(M, N, P)."; + anthem::translate("input", input, context); + + REQUIRE(output.str() == "V1 in M and V2 in N and V3 in P and exists X1, X2, X3 (X1 in M and X2 in N and X3 in P and s(X1, X2, X3)) and (p(V1, V2) or q(V3)) -> p(V1, V2) or q(V3)\n"); + } }