Added tests covering completion of integrity constraints and facts.

This commit is contained in:
Patrick Lühne 2017-04-08 18:50:42 +02:00
parent 350f31d0fd
commit a1648e27c9
No known key found for this signature in database
GPG Key ID: 05F3611E97A70ABF
1 changed files with 18 additions and 0 deletions

View File

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