The script executes two test cases for the %assertManual macro. The first case calls %assertManual without a description, verifying that the default value is recorded. The second case calls %assertManual with a specified description, verifying that this description is correctly recorded. Assertions check the values recorded in the SASUnit-generated test results table 'tst'.
Data Analysis
Type : CREATION_INTERNE
Data is created and managed internally by the SASUnit framework for recording test results (%assertDBValue checks an internal SASUnit 'tst' table).
1 Code Block
Macros SASUnit
Explanation : This block initializes a new test scenario for 'assertManual.sas'. It then defines the first test case, without an explicit description for %assertManual. The %assertDBValue macros are used to verify that the SASUnit 'tst' results table contains the expected values for the assertion type, the default description ('Manual assert - serves as placeholder'), and the test result.
%initTestcase(i_object=assertManual.sas, i_desc=%str(call without description))
6
%endTestcall()
7
%assertManual()
8
%markTest()
9
options mlogic symbolgen mprint SOURCE notes;
10
%assertDBValue(tst,type,assertManual)
11
%assertDBValue(tst,desc,Manual assert - serves as placeholder)
12
%assertDBValue(tst,exp,)
13
%assertDBValue(tst,act,)
14
%assertDBValue(tst,res,1)
15
%endTestcase(i_assertLog=0)
2 Code Block
Macros SASUnit
Explanation : This block defines the second test case, this time with a specific description ('the description 1') provided to %assertManual. The %assertDBValue macros verify that the 'tst' table correctly records this custom description, as well as the assertion type and result. The test scenario is then closed by %endScenario.
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/.
SAS and all other SAS Institute Inc. product or service names are registered trademarks or trademarks of SAS Institute Inc. in the USA and other countries. ® indicates USA registration. WeAreCAS is an independent community site and is not affiliated with SAS Institute Inc.
This site uses technical and analytical cookies to improve your experience.
Read more.