/* unit tests for HW 5, Prolog Warmup, CSE 341, Winter 2014 */ /* read in a file prolog_warmup.pl (so you should call your homework this!) */ :- consult(prolog_warmup). :- begin_tests(hw5). test(repeat, [nondet]) :- repeat(squid,[]). test(repeat, [nondet]) :- repeat(squid,[squid,squid,squid,squid]). test(repeat, [fail]) :- repeat(squid,[squid,squid,squid,clam]). test(average) :- average([1,2,3,4,5],3). test(average, [fail]) :- average([],_). test(sentence, [nondet]) :- sentence(the,octopus,swims). test(sentence, [nondet]) :- sentence(the,dolphin,frolics). test(sentence, [fail]) :- sentence(the,dolphin,octopus). :- end_tests(hw5). :- run_tests.