From 790162532ee0ad6c8fad9e83203213d243d28534 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Patrick=20L=C3=BChne?= Date: Thu, 24 Nov 2016 15:51:11 +0100 Subject: [PATCH] Added unit test for 0-ary facts. --- tests/TestTranslation.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/tests/TestTranslation.cpp b/tests/TestTranslation.cpp index 994eeed..67be5d9 100644 --- a/tests/TestTranslation.cpp +++ b/tests/TestTranslation.cpp @@ -73,6 +73,14 @@ TEST_CASE("[translation] Rules are translated correctly", "[translation]") REQUIRE(output.str() == "V1 in 42 -> p(V1)\n"); } + SECTION("0-ary fact") + { + input << "p."; + anthem::translate("input", input, context); + + REQUIRE(output.str() == "#true -> p\n"); + } + SECTION("integrity constraint") { input << ":- p(42).";