1
0
mirror of https://github.com/sasjs/core.git synced 2025-12-15 16:14:36 +00:00

feat: ms_creategroup and ms_getgroups macros with associated tests

This commit is contained in:
Allan
2022-05-17 14:40:38 +00:00
committed by GitHub
parent de4ea8888f
commit ed11d44fe8
4 changed files with 317 additions and 0 deletions

View File

@@ -0,0 +1,50 @@
/**
@file
@brief Testing ms_creategroup.sas macro
<h4> SAS Macros </h4>
@li mf_getuniquename.sas
@li mp_assert.sas
@li mp_assertscope.sas
@li ms_creategroup.sas
@li ms_getgroups.sas
**/
%let group=%substr(%mf_getuniquename(),1,8);
%mp_assertscope(SNAPSHOT)
%ms_creategroup(&group, desc=The description,mdebug=&sasjs_mdebug,outds=test1)
%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 group was created with an ID,
outds=work.test_results
)
/* double check by querying the list of users */
%ms_getgroups(outds=work.test2)
%let checkid=0;
data _null_;
set work.test2;
where name="&group";
call symputx('checkid',id);
run;
%mp_assert(
iftrue=(&checkid=&id),
desc=Checking that fetched group exists and has the same ID,
outds=work.test_results
)

View File

@@ -0,0 +1,23 @@
/**
@file
@brief Testing ms_getgroups.sas macro
<h4> SAS Macros </h4>
@li ms_getgroups.sas
@li mp_assertdsobs.sas
@li mp_assertscope.sas
**/
%mp_assertscope(SNAPSHOT)
%ms_getgroups(outds=work.test1,mdebug=&sasjs_mdebug)
%mp_assertscope(COMPARE
,ignorelist=MCLIB0_JADP1LEN MCLIB0_JADPNUM MCLIB0_JADVLEN
)
%mp_assertdsobs(work.test1,test=ATLEAST 1)