Macros for SAS Application Developers
https://github.com/sasjs/core
Loading...
Searching...
No Matches
mf_abort.test.sas
Go to the documentation of this file.
1/**
2 @file
3 @brief Testing mf_abort macro
4
5 <h4> SAS Macros </h4>
6 @li mf_abort.sas
7 @li mp_assert.sas
8 @li mp_assertscope.sas
9
10**/
11
12/* mf_abort is deprecated in favour of mp_abort, but its behaviour is still
13 relied on: mf_verifymacvars and the viya mfv_* macros call it, and the
14 default SASjs CLI service and test templates declare it as a dependency, so
15 every compiled build inlines it. Its behaviour is therefore pinned here.
16
17 The aborting path cannot be exercised from a test - ABORT ends the session
18 and the runner would never report. What is tested is the decision in front
19 of it: a false condition must return without aborting. */
20
21%mp_assertscope(SNAPSHOT)
22%put scope check:
23 %mf_abort(iftrue=%str(1=0),mac=mf_abort.test.sas,msg=not triggered);
24%mp_assertscope(COMPARE,
25 desc=Checking that mf_abort does not leak scope,
26 outds=work.test_results
27)
28
29%mp_assert(
30 iftrue=(&syscc=0),
31 desc=Checking that a false comparison returns without aborting,
32 outds=work.test_results
33)
34
35%mf_abort(iftrue=0,mac=mf_abort.test.sas,msg=not triggered)
36
37%mp_assert(
38 iftrue=(&syscc=0),
39 desc=Checking that iftrue=0 returns without aborting,
40 outds=work.test_results
41)