【发布时间】:2020-01-18 15:47:44
【问题描述】:
假设我有一个 hello_name.pl:
greeting (Name): -
write ('hello'),
write (Name),
writeln ('!').
我想在我的 plunit 中放入类似的东西
catch_output (greeting ('Moncho'), ConsoleOutput),
assertion ('hello Moncho!' =:= ConsoleOutput).
【问题讨论】:
-
作为附录,不要使用
write(它的意思是这样的序列化术语),使用format。我准备了一些关于“在 Prolog 中打印”in this gist(正在进行中)的概述。 -
@DavidTonhofer 谢谢先生,我在Codewars kata I've created添加了您的链接
标签: unit-testing console prolog output plunit