Published on :
Macro CREATION_INTERNE

Unit Test of the Import Macro

This code is also available in: Deutsch Español Français
This script executes a series of tests to verify the proper functioning of the %import macro. It tests simple calls, deletion of existing macros via %sysmacdelete, and validates reloading (import) via assertions (%asserteq) on the existence of macros in the catalog (%sysmacexist).
Data Analysis

Type : CREATION_INTERNE


No data table is read or created. The processing is purely logical and acts on the session's macro dictionary.

1 Code Block
MACRO CALL
Explanation :
Tests of the %import macro call with different arguments (empty, lowercase, uppercase) to ensure call robustness.
Copied!
1%import();
2%import(import);
3%import(IMPORT);
2 Code Block
MACRO CALL
Explanation :
Complete test scenario: forced deletion of the 'option' macro, validation of its deletion via assertion, re-importation of the macro, and final validation of its presence.
Copied!
1%sysmacdelete option;
2%asserteq(0,%sysmacexist(option));
3%import(OPTION);
4%asserteq(1,%sysmacexist(option));
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.