-
-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: adding (and fixing) tests for ms_* macro suite
- Loading branch information
munja
committed
Apr 21, 2022
1 parent
6b25749
commit 63bf00e
Showing
7 changed files
with
117 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
/** | ||
@file | ||
@brief Testing ms_createuser.sas macro | ||
<h4> SAS Macros </h4> | ||
@li mf_getuniquename.sas | ||
@li mp_assert.sas | ||
@li mp_assertscope.sas | ||
@li ms_createuser.sas | ||
@li ms_getusers.sas | ||
**/ | ||
|
||
%let user=%substr(%mf_getuniquename(),1,8); | ||
|
||
%mp_assertscope(SNAPSHOT) | ||
%ms_createuser(&user,passwrd,outds=test1,mdebug=&sasjs_mdebug) | ||
%mp_assertscope(COMPARE | ||
,ignorelist=MCLIB0_JADP1LEN MCLIB0_JADPNUM MCLIB0_JADVLEN | ||
) | ||
|
||
%let id=0; | ||
data _null_; | ||
set work.test1; | ||
call symputx('id',id); | ||
run; | ||
%mp_assert( | ||
iftrue=(&id>0), | ||
desc=Checking that user was created with an ID, | ||
outds=work.test_results | ||
) | ||
|
||
/* double check by querying the list of users */ | ||
%ms_getusers(outds=work.test2) | ||
%let checkid=0; | ||
data _null_; | ||
set work.test2; | ||
where username="&user"; | ||
call symputx('checkid',id); | ||
run; | ||
%mp_assert( | ||
iftrue=(&checkid=&id), | ||
desc=Checking that fetched user exists and has the same ID, | ||
outds=work.test_results | ||
) | ||
|
||
|
||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
/** | ||
@file | ||
@brief Testing ms_getusers.sas macro | ||
<h4> SAS Macros </h4> | ||
@li ms_getusers.sas | ||
@li mp_assertdsobs.sas | ||
@li mp_assertscope.sas | ||
**/ | ||
|
||
|
||
%mp_assertscope(SNAPSHOT) | ||
%ms_getusers(outds=work.test1,mdebug=&sasjs_mdebug) | ||
%mp_assertscope(COMPARE | ||
,ignorelist=MCLIB0_JADP1LEN MCLIB0_JADPNUM MCLIB0_JADVLEN | ||
) | ||
|
||
%mp_assertdsobs(work.test1,test=ATLEAST 1) | ||
|
||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters