Unit testing: Check result of e.g. verifyEqual
Mostrar comentarios más antiguos
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
Respuesta aceptada
Más respuestas (0)
Categorías
Más información sobre Run Unit Tests en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!