mirror of
https://github.com/sasjs/core.git
synced 2026-01-03 15:40:05 +00:00
feat: adding mf_getfmtlist() and mf_getfmtname() macros and associated tests. Also added &sasjswork as a global macro variable in mp_init().
This commit is contained in:
33
tests/crossplatform/mf_getfmtlist.test.sas
Normal file
33
tests/crossplatform/mf_getfmtlist.test.sas
Normal file
@@ -0,0 +1,33 @@
|
||||
/**
|
||||
@file
|
||||
@brief Testing mf_getfmtlist macro
|
||||
|
||||
<h4> SAS Macros </h4>
|
||||
@li mf_getfmtlist.sas
|
||||
@li mp_assert.sas
|
||||
|
||||
**/
|
||||
|
||||
%mp_assert(
|
||||
iftrue=(
|
||||
"%mf_getfmtlist(sashelp.prdsale)"="DOLLAR $CHAR W MONNAME"
|
||||
),
|
||||
desc=Checking basic numeric,
|
||||
outds=work.test_results
|
||||
)
|
||||
|
||||
%mp_assert(
|
||||
iftrue=(
|
||||
"%mf_getfmtlist(sashelp.shoes)"="$CHAR BEST DOLLAR"
|
||||
),
|
||||
desc=Checking basic char,
|
||||
outds=work.test_results
|
||||
)
|
||||
|
||||
%mp_assert(
|
||||
iftrue=(
|
||||
"%mf_getfmtlist(sashelp.demographics)"="BEST Z $CHAR COMMA PERCENTN"
|
||||
),
|
||||
desc=Checking longer numeric,
|
||||
outds=work.test_results
|
||||
)
|
||||
33
tests/crossplatform/mf_getfmtname.test.sas
Normal file
33
tests/crossplatform/mf_getfmtname.test.sas
Normal file
@@ -0,0 +1,33 @@
|
||||
/**
|
||||
@file
|
||||
@brief Testing mf_getfmtname macro
|
||||
|
||||
<h4> SAS Macros </h4>
|
||||
@li mf_getfmtname.sas
|
||||
@li mp_assert.sas
|
||||
|
||||
**/
|
||||
|
||||
%mp_assert(
|
||||
iftrue=(
|
||||
"%mf_getfmtname(8.)"="W"
|
||||
),
|
||||
desc=Checking basic numeric,
|
||||
outds=work.test_results
|
||||
)
|
||||
|
||||
%mp_assert(
|
||||
iftrue=(
|
||||
"%mf_getfmtname($4.)"="$CHAR"
|
||||
),
|
||||
desc=Checking basic char,
|
||||
outds=work.test_results
|
||||
)
|
||||
|
||||
%mp_assert(
|
||||
iftrue=(
|
||||
"%mf_getfmtname(comma14.10)"="COMMA"
|
||||
),
|
||||
desc=Checking longer numeric,
|
||||
outds=work.test_results
|
||||
)
|
||||
Reference in New Issue
Block a user