Permalink
Switch branches/tags
Nothing to show
Find file
Fetching contributors…
Cannot retrieve contributors at this time
25 lines (21 sloc) 655 Bytes
function ok(good, comment)
%% ok(num, comment)
%% Indicate that test num has passed with comment.
%% The behavior of ok() might be altered by other functions, such as
%% start_todo() or end_todo()
global _TAP_TODO; % if this is 1, we're in todo mode
global _TAP_TODO_MSG; % the todo message,
global _TAP_TEST_CNT; % the number of the current test
if good == 0
printf("not ");
end
printf("ok %d", _TAP_TEST_CNT);
if nargin == 2
printf(" - %s", comment);
end
if _TAP_TODO == 1
printf(" # TODO %s", _TAP_TODO_MSG);
end
printf("\n");
_TAP_TEST_CNT = _TAP_TEST_CNT + 1;
endfunction