diff --git a/toolbox/is.m b/toolbox/is.m index 4fcc0b8..b1c9292 100644 --- a/toolbox/is.m +++ b/toolbox/is.m @@ -3,5 +3,9 @@ function is(a, b, comment) %% tests that the two values a and b are equal. Calls ok() to handle %% the test output logic, so has all the same capabilities as that %% function. - ok(a == b, comment); -endfunction \ No newline at end of file + if nargin == 2 + ok(a == b, comment); + else + ok(a == b); + endif +endfunction diff --git a/toolbox/nok.m b/toolbox/nok.m index 10c7f14..0fa14f4 100644 --- a/toolbox/nok.m +++ b/toolbox/nok.m @@ -9,5 +9,10 @@ function nok(bad, comment) else bad = 0; end - ok(bad, comment); + + if nargin == 2 + ok(bad, comment); + else + ok(bad); + endif endfunction diff --git a/toolbox/ok.m b/toolbox/ok.m index 4c945a2..896ade0 100644 --- a/toolbox/ok.m +++ b/toolbox/ok.m @@ -8,9 +8,12 @@ function ok(good, comment) global _TAP_TEST_CNT; % the number of the current test if good == 0 - printf("not ok %d %s", _TAP_TEST_CNT, comment); - else - printf("ok %d %s", _TAP_TEST_CNT, comment); + printf("not "); + end + printf("ok %d", _TAP_TEST_CNT); + + if nargin == 2 + printf(" %s", comment); end if _TAP_TODO == 1