I am using Matlab's unittest to test the handling of invalid parameters.
In the test I have a line
t.verifyError(@myObject.myMethod, 'MATLAB:nonStrucReference'); which works fine in Matlab R2014a, but fails in Matlab R2016a with the message
--------------------- Framework Diagnostic: --------------------- verifyError failed. --> The function threw the wrong exception. Actual Exception: 'MATLAB:structRefFromNonStruct' Expected Exception: 'MATLAB:nonStrucReference' I wonder if it would be possible to test whether one of the exceptions is thrown.
I know that it would be possible to write
t.verifyError(@myObject.myMethod, ?MException); but something more specific would be better.