mirror of
https://github.com/sasjs/core.git
synced 2026-01-06 09:00:06 +00:00
feat: new macros (mp_reseterror and mp_init), new datetime format added to mp_getcols, and stub prepared for mp_makedata
This commit is contained in:
24
tests/crossplatform/mp_init.test.sas
Normal file
24
tests/crossplatform/mp_init.test.sas
Normal file
@@ -0,0 +1,24 @@
|
||||
/**
|
||||
@file
|
||||
@brief Testing mp_gsubfile.sas macro
|
||||
|
||||
<h4> SAS Macros </h4>
|
||||
@li mp_init.sas
|
||||
@li mp_assert.sas
|
||||
|
||||
**/
|
||||
|
||||
/**
|
||||
* Test 1 - mp_init.sas actually already ran as part of testinit
|
||||
* So lets test to make sure it will not run again
|
||||
*/
|
||||
|
||||
%let initial_value=&sasjs_init_num;
|
||||
|
||||
%mp_init();
|
||||
|
||||
%mp_assert(
|
||||
iftrue=("&initial_value"="&sasjs_init_num"),
|
||||
desc=Check that mp_init() did not run twice,
|
||||
outds=work.test_results
|
||||
)
|
||||
@@ -5,6 +5,7 @@
|
||||
<h4> SAS Macros </h4>
|
||||
@li mp_lockfilecheck.sas
|
||||
@li mp_assert.sas
|
||||
@li mp_reseterror.sas
|
||||
|
||||
**/
|
||||
|
||||
@@ -29,6 +30,8 @@ data work.test; a=1;run;
|
||||
|
||||
%mp_lockfilecheck(sashelp.class)
|
||||
|
||||
%mp_reseterror()
|
||||
|
||||
%mp_assert(
|
||||
iftrue=(&success=1),
|
||||
desc=Checking sashelp table cannot be locked,
|
||||
|
||||
23
tests/crossplatform/mp_reseterror.test.sas
Normal file
23
tests/crossplatform/mp_reseterror.test.sas
Normal file
@@ -0,0 +1,23 @@
|
||||
/**
|
||||
@file
|
||||
@brief Testing mp_reseterror macro
|
||||
|
||||
<h4> SAS Macros </h4>
|
||||
@li mp_assert.sas
|
||||
@li mp_reseterror.sas
|
||||
|
||||
**/
|
||||
|
||||
|
||||
/* cause an error */
|
||||
|
||||
lock sashelp.class;
|
||||
|
||||
/* recover ? */
|
||||
%mp_reseterror()
|
||||
|
||||
%mp_assert(
|
||||
iftrue=(&success=1),
|
||||
desc=Checking sashelp table cannot be locked,
|
||||
outds=work.test_results
|
||||
)
|
||||
Reference in New Issue
Block a user