Published on :
Quality / Test CREATION_INTERNE

Unit test for mm_getauthinfo macro

This code is also available in: Deutsch Español Français
This program uses the test framework (likely SASjs Core) to validate the `mm_getauthinfo` macro. It performs two types of checks: a technical one via `%mp_assertscope` to ensure no local macro variables leak into the global environment (encapsulation), and a functional one via `%mp_assert` to confirm that the target data table (`auths`) is correctly generated after execution.
Data Analysis

Type : CREATION_INTERNE


Data is generated by the tested macro (`mm_getauthinfo`) which creates the `work.auths` table.

1 Code Block
MACRO
Explanation :
Encapsulation test sequence. `SNAPSHOT` captures the state of macro variables. The target macro `%mm_getauthinfo` is executed to create the `auths` table. `COMPARE` then checks that no temporary macro variables have been left in the global environment.
Copied!
1%mp_assertscope(SNAPSHOT)
2%mm_getauthinfo(outds=auths)
3%mp_assertscope(COMPARE)
2 Code Block
MACRO
Explanation :
Final assertion checking functional success. The `%mf_existds` macro is used to test the existence of the `work.auths` table. If it returns 1 (true), the test is considered successful.
Copied!
1%mp_assert(
2 iftrue=(%mf_existds(work.auths)=1),
3 desc=Check IF the auths dataset was created
4)
This material is provided "as is" by We Are Cas. There are no warranties, expressed or implied, as to merchantability or fitness for a particular purpose regarding the materials or code contained herein. We Are Cas is not responsible for errors in this material as it now exists or will exist, nor does We Are Cas provide technical support for it.