mirror of
https://github.com/sasjs/core.git
synced 2026-01-10 10:50:04 +00:00
fix: updating tests per https://github.com/sasjs/cli/issues/1101
This commit is contained in:
8
all.sas
8
all.sas
@@ -242,11 +242,11 @@ https://github.com/yabwon/SAS_PACKAGES/blob/main/packages/baseplus.md#functionex
|
|||||||
/** @endcond *//**
|
/** @endcond *//**
|
||||||
@file
|
@file
|
||||||
@brief Checks if a variable exists in a data set.
|
@brief Checks if a variable exists in a data set.
|
||||||
@details Returns 0 if the variable does NOT exist, and return the position of
|
@details Returns 0 if the variable does NOT exist, and the position of the var
|
||||||
the var if it does.
|
if it does.
|
||||||
Usage:
|
Usage:
|
||||||
|
|
||||||
%put %mf_existvar(work.someds, somevar)
|
%put %mf_existvar(work.someds, somevar)
|
||||||
|
|
||||||
@param [in] libds 2 part dataset or view reference
|
@param [in] libds 2 part dataset or view reference
|
||||||
@param [in] var variable name
|
@param [in] var variable name
|
||||||
|
|||||||
@@ -1,11 +1,11 @@
|
|||||||
/**
|
/**
|
||||||
@file
|
@file
|
||||||
@brief Checks if a variable exists in a data set.
|
@brief Checks if a variable exists in a data set.
|
||||||
@details Returns 0 if the variable does NOT exist, and return the position of
|
@details Returns 0 if the variable does NOT exist, and the position of the var
|
||||||
the var if it does.
|
if it does.
|
||||||
Usage:
|
Usage:
|
||||||
|
|
||||||
%put %mf_existvar(work.someds, somevar)
|
%put %mf_existvar(work.someds, somevar)
|
||||||
|
|
||||||
@param [in] libds 2 part dataset or view reference
|
@param [in] libds 2 part dataset or view reference
|
||||||
@param [in] var variable name
|
@param [in] var variable name
|
||||||
|
|||||||
@@ -37,8 +37,8 @@
|
|||||||
desc=Check original returns 1
|
desc=Check original returns 1
|
||||||
)
|
)
|
||||||
%mp_assert(
|
%mp_assert(
|
||||||
iftrue=(%mcf_init(t)=0),
|
iftrue=(%mcf_init(t)=1),
|
||||||
desc=Check subset returns 0
|
desc=Check subset returns 1
|
||||||
)
|
)
|
||||||
%mp_assert(
|
%mp_assert(
|
||||||
iftrue=(&syscc=0),
|
iftrue=(&syscc=0),
|
||||||
|
|||||||
@@ -10,13 +10,11 @@
|
|||||||
|
|
||||||
|
|
||||||
%mp_assert(
|
%mp_assert(
|
||||||
iftrue=(%mf_existvar(sashelp.class,age)=1),
|
iftrue=(%mf_existvar(sashelp.class,age)>0),
|
||||||
desc=Checking existing var exists,
|
desc=Checking existing var exists
|
||||||
outds=work.test_results
|
|
||||||
)
|
)
|
||||||
|
|
||||||
%mp_assert(
|
%mp_assert(
|
||||||
iftrue=(%mf_existvar(sashelp.class,isjustanumber)=0),
|
iftrue=(%mf_existvar(sashelp.class,isjustanumber)=0),
|
||||||
desc=Checking non existing var does not exist,
|
desc=Checking non existing var does not exist
|
||||||
outds=work.test_results
|
|
||||||
)
|
)
|
||||||
@@ -34,7 +34,7 @@ run;
|
|||||||
%mp_applyformats(work.cols2)
|
%mp_applyformats(work.cols2)
|
||||||
|
|
||||||
%mp_assert(
|
%mp_assert(
|
||||||
iftrue=("&orig_fmt"=""),
|
iftrue=("&origfmt"=""),
|
||||||
desc=Check that formats were cleared,
|
desc=Check that formats were cleared,
|
||||||
outds=work.test_results
|
outds=work.test_results
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -41,7 +41,7 @@ run;
|
|||||||
outquery=work.query,
|
outquery=work.query,
|
||||||
mdebug=1
|
mdebug=1
|
||||||
)
|
)
|
||||||
%mp_assert(iftrue=(&syscc>0),
|
%mp_assert(iftrue=(&syscc=0),
|
||||||
desc=Ensure macro runs without errors,
|
desc=Ensure macro runs without errors,
|
||||||
outds=work.test_results
|
outds=work.test_results
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -52,14 +52,13 @@ create table work.example2(
|
|||||||
%mp_getpk(work,ds=example2,outds=test2)
|
%mp_getpk(work,ds=example2,outds=test2)
|
||||||
|
|
||||||
data _null_;
|
data _null_;
|
||||||
set work.test1;
|
set work.test2;
|
||||||
call symputx('test2',pk_fields);
|
call symputx('test2',pk_fields);
|
||||||
run;
|
run;
|
||||||
|
|
||||||
%mp_assert(
|
%mp_assert(
|
||||||
iftrue=("&test2"="TX_FROM DD_TYPE"),
|
iftrue=("&test2"="TX_FROM DD_TYPE"),
|
||||||
desc=mp_getpk gets unique constraint with NOT NULL in correct order,
|
desc=mp_getpk gets unique constraint with NOT NULL in correct order
|
||||||
outds=work.test_results
|
|
||||||
)
|
)
|
||||||
|
|
||||||
/* unique key without NOT NULL NOT captured */
|
/* unique key without NOT NULL NOT captured */
|
||||||
@@ -71,8 +70,7 @@ create table work.example3(
|
|||||||
DD_SHORTDESC char(256),
|
DD_SHORTDESC char(256),
|
||||||
constraint unq1 unique(tx_from, dd_type),
|
constraint unq1 unique(tx_from, dd_type),
|
||||||
constraint unq2 unique(tx_from, dd_type, dd_source),
|
constraint unq2 unique(tx_from, dd_type, dd_source),
|
||||||
constraint nnn not null(tx_from),
|
constraint nnn not null(tx_from)
|
||||||
constraint nnnn not null(dd_type)
|
|
||||||
);
|
);
|
||||||
%mp_getpk(work,ds=example3,outds=test3)
|
%mp_getpk(work,ds=example3,outds=test3)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user