Unit testing: Check result of e.g. verifyEqual
Ältere Kommentare anzeigen
In a unit test, I have many lines such as:
verifyEqual(testCase,1.5,x);
Next I would like to have an 'if' statement to execute one of two code blocks depending on whether that verification was successful or failed. Does verifyEqual store its result somewhere that I can check, maybe in testCase, or must I duplicate the test on my own in order to check the result?
Honestly, I find it surprising that this is not supported:
thisResult = verifyEqual(testCase,1.5,x);
if ~thisResult % MATLAB complains here because verifyEqual does not return an output
disp('problem here'); % My goal is to set a debugger breakpoint on this line.
end
Any suggestions? Thanks
Akzeptierte Antwort
Weitere Antworten (0)
Kategorien
Mehr zu Write Unit Tests finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!