expectAbort

expectAbort(expect: Boolean);

The expectAbort method of the JadeTestCase class is invoked by a user test method to register that the test is expected to abort execution.

A test method that is aborted is considered to have failed, unless this method has first been called with the value of the expect parameter evaluating to true.

In the following examples, an exception will be raised, the handler will abort execution of the method, and the test considered to have passed.

handlerThatAborts(ex: Exception): Integer;
begin
    return Ex_Abort_Action;
end;
someTest() unitTest;
begin
    on Exception do handlerThatAborts(exception);
    expectAbort(true);
    write 1/0;
end;

2022.0.02 and higher