Unit testing: Check result of e.g. verifyEqual
Afficher commentaires plus anciens
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
Réponse acceptée
Plus de réponses (0)
Catégories
En savoir plus sur Run Unit Tests dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!