Published on :
Macro CREATION_INTERNE

Unit Tests with Assertions

This code is also available in: Deutsch Español Français
This program illustrates the use of the %asserteq macro to validate equality conditions. It performs checks on integers, strings containing spaces, and empty strings.
Data Analysis

Type : CREATION_INTERNE


The script does not manipulate any SAS tables. It operates solely on literal values passed as macro parameters.

1 Code Block
MACRO CALL
Explanation :
Successive calls to the %asserteq macro to check for identity between different values (numeric, string with space, empty string).
Copied!
1%*Please write test code here;;
2%*%asserteq( ,%asserteq());
3%*%assertne( ,%asserteq());
4%*%assertref( );
5 
6%asserteq(1,1);
7%asserteq(x x,x x);
8%asserteq(%str(),%str());
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.