1
0
mirror of https://github.com/sasjs/core.git synced 2026-01-05 08:30:06 +00:00

fix: updating test cases

This commit is contained in:
munja
2022-01-25 12:45:32 +01:00
parent 11d073c10a
commit 794ceec33c
4 changed files with 74 additions and 24 deletions

36
all.sas
View File

@@ -3032,8 +3032,15 @@ run;
makes it easy to detect whether any macro variables were modified or
changed.
If you would like this feature, feel free to contribute / raise an issue /
engage the SASjs team directly.
The following variables are NOT tested (as they are known, global variables
used in SASjs):
@li &sasjs_prefix._FUNCTIONS
Global variables are initialised in mp_init.sas - which will also trigger
"strict mode" in your SAS session. Whilst this is a default in SASjs
produced apps, if you prefer not to use this mode, simply instantiate the
following variable to prevent the macro from running: `SASJS_PREFIX`
Example usage:
@@ -3054,6 +3061,8 @@ run;
@param [in] scope= (GLOBAL) The scope of the variables to be checked. This
corresponds to the values in the SCOPE column in `sashelp.vmacro`.
@param [in] desc= (Testing scope leakage) The user provided test description
@param [in] ignorelist= Provide a list of macro variable names to ignore from
the comparison
@param [in,out] scopeds= (work.mp_assertscope) The dataset to contain the
scope snapshot
@param [out] outds= (work.test_results) The output dataset to contain the
@@ -3062,6 +3071,10 @@ run;
|---|---|---|
|User Provided description|PASS|No out of scope variables created or modified|
<h4> SAS Macros </h4>
@li mf_getquotedstr.sas
@li mp_init.sas
<h4> Related Macros </h4>
@li mp_assert.sas
@li mp_assertcols.sas
@@ -3078,9 +3091,18 @@ run;
desc=Testing Scope Leakage,
scope=GLOBAL,
scopeds=work.mp_assertscope,
ignorelist=,
outds=work.test_results
)/*/STORE SOURCE*/;
%local ds test_result test_comments del add mod;
%local ds test_result test_comments del add mod ilist;
%let ilist=%upcase(&sasjs_prefix._FUNCTIONS &ignorelist);
/**
* this sets up the global vars, it will also enter STRICT mode. If this
* behaviour is not desired, simply initiate the following global macro
* variable to prevent the macro from running: SASJS_PREFIX
*/
%mp_init()
/* get current variables */
%if &action=SNAPSHOT %then %do;
@@ -3088,7 +3110,7 @@ run;
create table &scopeds as
select name,offset,value
from dictionary.macros
where scope="&scope"
where scope="&scope" and name not in (%mf_getquotedstr(&ilist))
order by name,offset;
%end;
%else %if &action=COMPARE %then %do;
@@ -3097,7 +3119,7 @@ run;
create table _data_ as
select name,offset,value
from dictionary.macros
where scope="&scope"
where scope="&scope" and name not in (%mf_getquotedstr(&ilist))
order by name,offset;
%let ds=&syslast;
@@ -10129,7 +10151,7 @@ create table &delrec as
from &outdel a
left join &base b
on &keyjoin
where a.%scan(&key,1) is null
where b.%scan(&key,1) is null
order by &commakey;
data &delerr;
@@ -10237,7 +10259,7 @@ select distinct tgtvar_nm into: missvars separated by ' '
from &outmod a
left join &base b
on &keyjoin
where a.%scan(&key,1) is null
where b.%scan(&key,1) is null
order by &commakey;
data &moderr;
if 0 then set &errds;