From a1648e27c922339e718da98dba099a612a3eb299 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Patrick=20L=C3=BChne?= Date: Sat, 8 Apr 2017 18:50:42 +0200 Subject: [PATCH] Added tests covering completion of integrity constraints and facts. --- tests/TestCompletion.cpp | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/tests/TestCompletion.cpp b/tests/TestCompletion.cpp index ab8b95d..6f827fd 100644 --- a/tests/TestCompletion.cpp +++ b/tests/TestCompletion.cpp @@ -47,4 +47,22 @@ TEST_CASE("[completion] Rules are completed", "[completion]") REQUIRE(output.str() == "(p <-> (s or q))\n(q <-> (t or r))\n(r <-> t)\n"); } + + SECTION("integrity constraints") + { + input << ":- q.\n" + ":- s(5)."; + anthem::translate("input", input, context); + + REQUIRE(output.str() == "not q\nnot s(5)\n"); + } + + SECTION("facts") + { + input << "q.\n" + "r."; + anthem::translate("input", input, context); + + REQUIRE(output.str() == "(q <-> #true)\n(r <-> #true)\n"); + } }