Macros for SAS Application Developers
https://github.com/sasjs/core
Loading...
Searching...
No Matches
mv_getfoldermembers.test.4.sas
Go to the documentation of this file.
1/**
2 @file
3 @brief Test a failed folder lookup is not returned as an empty listing
4 @details A nonexistent path must fail before an output table is made.
5 The abort override records the outcome and terminates this test session.
6
7 <h4> SAS Macros </h4>
8 @li mf_getuniquename.sas
9 @li mp_assert.sas
10 @li mv_getfoldermembers.sas
11
12**/
13
14%macro mp_abort(iftrue=,mac=,msg=);
15 %if not(%eval(%unquote(&iftrue))) %then %return;
16 %mp_assert(
17 iftrue=(&SYS_PROCHTTP_STATUS_CODE=404),
18 desc=The nonexistent folder lookup returns 404,
19 outds=work.test_results
20 )
21 %mp_assert(
22 iftrue=(%sysfunc(exist(work.failedlookup))=0),
23 desc=The failed lookup did not create an empty listing,
24 outds=work.test_results
25 )
26 %webout(OPEN)
27 %webout(OBJ,TEST_RESULTS)
28 %webout(CLOSE)
29 %let syscc=0;
30 data _null_;
31 abort cancel nolist;
32 run;
33%mend mp_abort;
34
35%let missingfolder=%mf_getuniquename();
36%mv_getfoldermembers(root=&mcTestAppLoc/&missingfolder,
37 outds=work.failedlookup)
38
39%mp_assert(
40 iftrue=(0=1),
41 desc=The failed folder lookup must abort,
42 outds=work.test_results
43)