The script does not manipulate external data or data from standard SAS libraries like SASHELP. It operates on the creation and assignment of temporary librefs to the `work` library. Test results are stored in the `work.test_results` table, dynamically generated during script execution.
1 Code Block
SASUnit Macro Calls Data
Explanation : This block performs tests for valid librefs. It initializes a snapshot of the environment, then uses `mf_getuniquelibref` to create two unique librefs ('libshort' and 'lib7') with valid prefixes. Each libref is then assigned to the `work` library. Assertions via `%mp_assert` are used to verify that the assignment (`LIBNAME`) completed without error (`%syscc=0`), and the results are stored in `work.test_results`.
Explanation : This block tests cases where `mf_getuniquelibref` should fail. It attempts to generate librefs with invalid prefixes: 'lib8char' and 'invalidlib' (more than 8 characters), and '8adlib' (starting with a digit). For each test, `%mp_assert` verifies that the macro returns a value of 0, indicating that no valid libref could be created, and records these expected failures in `work.test_results`.
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.