Changes

Jump to navigation Jump to search

Tests

407 bytes added, 12:45, 11 September 2016
→‎Error: added %!warning and checking for particular ids
%!test foo (bar)
=== Error / Warning ===
It is also important to test that a function performs its checks correctly
and throws errors (or warnings) when it receives garbage. This can be done with{{codeline|error}} (or {{codeline|warning}}) blocks:
%!error foo () # test that causes any error
%!error <BAR must be a positive integer> foo (-1.5) # test that throws specific errormessage %!error id=Octave:invalid-fun-call foo () # test that throws specific error id
%!warning foo () # test that causes any warning
%!warning <negative values might give inaccurate results> foo (-1.5) # test that triggers a specific warning message
%!warning id=BAR:possibly-inaccurate-result foo (-1.5) # test that triggers a specific warning id
=== Shared functions ===
240

edits

Navigation menu