Macros for SAS Application Developers
https://github.com/sasjs/core
Loading...
Searching...
No Matches
mf_mkdir.test.sas
Go to the documentation of this file.
1/**
2 @file
3 @brief Testing mf_mkdir macro
4
5 <h4> SAS Macros </h4>
6 @li mf_mkdir.sas
7 @li mp_assert.sas
8 @li mp_assertscope.sas
9
10**/
11
12%let root=%sysfunc(pathname(work))/mkdir_test;
13
14%mp_assertscope(SNAPSHOT)
15%put scope check:%mf_mkdir(&root/a/b/c);
16%mp_assertscope(COMPARE,
17 desc=Checking that mf_mkdir does not leak scope,
18 outds=work.test_results
19)
20
21%mp_assert(
22 iftrue=(%sysfunc(fileexist(&root/a/b/c))=1),
23 desc=Checking that intermediate directories are created,
24 outds=work.test_results
25)
26
27%mf_mkdir(&root/a/b/c/)
28%mp_assert(
29 iftrue=(&syscc=0 and %sysfunc(fileexist(&root/a/b/c))=1),
30 desc=Checking that a trailing slash is accepted and an existing path is quiet,
31 outds=work.test_results
32)
33
34%mf_mkdir(/)
35%mp_assert(
36 iftrue=(&syscc=0),
37 desc=Checking that a single slash is treated as an existing root,
38 outds=work.test_results
39)