Unit testing: Check result of e.g. verifyEqual
古いコメントを表示
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
採用された回答
その他の回答 (0 件)
カテゴリ
ヘルプ センター および File Exchange で Write Unit Tests についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!