With this program:
:- set_prolog_flag(optimise, true).
:- begin_tests(foo).
test(1) :-
true.
:- end_tests(foo).
compiling the buffer works fine (Ctrl-c Ctrl-b) but make/0 (Ctrl-c Ctrl-m) gives an error:
% /home/mike/odds_and_sods/test compiled 0.00 sec, 0 clauses
| ERROR: plunit:current_test/5: Unknown procedure: plunit_foo:'unit test'/4
ERROR: Unknown procedure: plunit_foo:'unit test'/4
ERROR: In:
ERROR: [15] throw(error(existence_error(procedure,...),context(...,_2108)))
ERROR: [13] read_term_with_history(_2132,[show(h),...|...]) at /home/mike/lib/swipl/boot/history.pl:55
ERROR: [11] call_cleanup('$toplevel':read_query('~! ?- ',_2188,_2190),'$toplevel':end_input_style) at /home/mike/lib/swipl/boot/init.pl:685
ERROR: [10] catch('$toplevel':call_cleanup(...,end_input_style),error(io_error(_2246,_2248),_2242),'$toplevel':fail) at /home/mike/lib/swipl/boot/init.pl:565