【发布时间】:2021-01-22 11:41:12
【问题描述】:
我正在尝试将我的 SWI Prolog 应用程序迁移到 GNU Prolog。不幸的是,我对单元测试有疑问。在 SWIPL 中,我们可以简单地使用 plunit 模块并编写如下测试用例:
:- begin_tests(my_tests).
test(my_predicate_test) :- my_predicate(Result), assertion(Result == [foo, bar]).
test(second_test) :- foo(10, X), assertion(X == "hello world").
:- end_tests(my_tests).
但是如何在 GNU Prolog 中实现单元测试呢?甚至像 crisp 这样的一些附加库也不适用于 gprolog。
【问题讨论】:
标签: unit-testing prolog gnu-prolog