Added unit test for 0-ary facts.

This commit is contained in:
Patrick Lühne 2016-11-24 15:51:11 +01:00
parent ac1f464ce3
commit 790162532e
Signed by: patrick
GPG Key ID: 05F3611E97A70ABF
1 changed files with 8 additions and 0 deletions

View File

@ -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).";