interpl

Experiments with intepreters in Prolog
git clone https://ccx.te2000.cz/git/interpl
Log | Files | Refs | README

test_helpers.pl (628B)


      1 :- module(test_helpers,
      2 	[ portray_long/0
      3 	, portray_depth/1
      4 	, test_one_result/3
      5 	]).
      6 
      7 :- use_module(library(debug), [assertion/1]).
      8 
      9 portray_long :- portray_depth(32).
     10 
     11 portray_depth(Depth) :-
     12 	set_prolog_flag(answer_write_options, [quoted(true), portrayed(true), max_depth(Depth), spacing(next_argument)]),
     13 	set_prolog_flag(debugger_write_options, [quoted(true), portrayed(true), max_depth(Depth), spacing(next_argument)]).
     14 
     15 
     16 :- meta_predicate(test_one_result(?, 0, ?)).
     17 test_one_result(Template, Goal, Output) :-
     18 	findall(Template, Goal, Results),
     19 	% write(Results), nl,
     20 	assertion(length(Results, 1)),
     21 	Results = [Output].