Macros for SAS Application Developers
https://github.com/sasjs/core
Loading...
Searching...
No Matches
mp_gitstatus.test.sas
Go to the documentation of this file.
1/**
2 @file
3 @brief Testing mp_gitstatus.sas macro
4
5 <h4> SAS Macros </h4>
6 @li mf_deletefile.sas
7 @li mf_writefile.sas
8 @li mp_assert.sas
9 @li mp_assertdsobs.sas
10 @li mp_gitstatus.sas
11
12**/
13
14/* clone the source repo */
15%let dir = %sysfunc(pathname(work))/core;
16%put source clone rc=%sysfunc(GITFN_CLONE(https://github.com/sasjs/core,&dir));
17
18%mp_gitstatus(&dir,outds=work.gitstatus)
19
20%mp_assert(
21 iftrue=(&syscc=0),
22 desc=Initial mp_gitstatus runs without errors,
23 outds=work.test_results
24)
25
26/* should be empty as there are no changes yet */
27%mp_assertdsobs(work.gitstatus,test=EMPTY)
28
29/* add a file */
30%mf_writefile(&dir/somefile.txt,l1=some content)
31/* change a file */
32%mf_writefile(&dir/readme.md,l1=new readme)
33/* delete a file */
34%mf_deletefile(&dir/package.json)
35
36/* re-run git status */
37%mp_gitstatus(&dir,outds=work.gitstatus)
38
39/* should be three changes now */
40%mp_assertdsobs(work.gitstatus,test=EQUALS 3)