Macros for SAS Application Developers
https://github.com/sasjs/core
Loading...
Searching...
No Matches
mp_abort.test.sas
Go to the documentation of this file.
1/**
2 @file
3 @brief Testing mp_abort macro
4
5 <h4> SAS Macros </h4>
6 @li mp_abort.sas
7 @li mp_assert.sas
8 @li mp_assertscope.sas
9
10 @details The aborting path cannot be exercised from a test - it ends the
11 session - so the assertions cover the decision in front of it.
12
13**/
14
15%mp_assertscope(SNAPSHOT)
16%put scope check:
17 %mp_abort(iftrue=%str(1=0),mac=mp_abort.test.sas,msg=not triggered);
18%mp_assertscope(COMPARE,
19 desc=Checking that mp_abort does not leak scope,
20 outds=work.test_results
21)
22
23%mp_assert(
24 iftrue=(&syscc=0),
25 desc=Checking that a false comparison returns without aborting,
26 outds=work.test_results
27)
28
29%mp_abort(iftrue=0)
30%mp_assert(
31 iftrue=(&syscc=0),
32 desc=Checking that iftrue=0 returns without aborting,
33 outds=work.test_results
34)
35
36/* mode=INCLUDE reads the abort record dataset; a row with iftrue='1=0' is the
37 state the branch exists for, and must return quietly */
38data work.mp_abort_errds;
39 length msg mac $1000;
40 call missing(msg,mac);
41 iftrue='1=0';
42run;
43%mp_abort(mode=INCLUDE)
44%mp_assert(
45 iftrue=(&syscc=0),
46 desc=Checking that mode=INCLUDE returns when nothing has aborted,
47 outds=work.test_results
48)