Published on :
Test INTERNAL_CREATION

Assertion Execution via Macro

This code is also available in: Deutsch Español Français
The script begins with a `%put` instruction that displays the text 'this is a test' in the SAS© log, often used for debugging or traceability purposes. It then calls the `%mp_assert` macro, typical of SAS© unit testing tools like SASUnit. This macro takes a logical condition (`iftrue=(1=1)`) as a parameter, which is evaluated, and a test description (`desc`). Since the condition `1=1` is always true, this assertion will always pass, confirming the proper functioning of the assertion mechanism and recording the associated description in the test results.
Data Analysis

Type : INTERNAL_CREATION


This script does not manipulate data from external sources. The `%put` instruction operates on a literal character string and the `%mp_assert` macro evaluates an internal logical condition (`1=1`), without requiring access to SAS datasets or external files.

1 Code Block
Global SAS Instruction
Explanation :
This block contains a `%put` instruction, a global SAS directive that writes text directly to the SAS log. It is commonly used for debugging, notifying execution status, or displaying informative messages during program processing.
Copied!
1%put this is a test;
2 Code Block
Macro Call
Explanation :
This `%mp_assert` macro call is an assertion function, typically found in SAS unit testing frameworks like SASUnit. It checks if the condition specified by `iftrue` is true. Here, the condition `1=1` is always true, ensuring the assertion will succeed. The `desc` parameter provides a description of the test, which is recorded with the assertion result.
Copied!
1%mp_assert(
2 iftrue=(1=1),
3 desc=My Test Description. This will always Pass!
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.
Copyright Info : Copyright 2010-2023 HMS Analytical Software GmbH, http://www.analytical-software.de This file is part of SASUnit, the Unit testing framework for SAS(R) programs. For copyright information and terms of usage under the GNU Lesser General Public License see included file README.md or https://github.com/HMS-Analytical-Software/SASUnit/wiki/readme/.