Last active
October 28, 2023 14:22
-
-
Save nicolashohm/620ed5e3079b26b6d24c67cf4aefed99 to your computer and use it in GitHub Desktop.
Assert methods like they exist in test frameworks for SAS
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
%macro assertEquals(expected, actual, message); | |
%if &expected ne &actual %then %do; | |
%put ERROR: Failed asserting that &actual is equal to &expected - &message; | |
%end; | |
%mend; | |
* Asserts that the value returned by the query in actual is equals to the expectation; | |
%macro assertSqlEquals(expected, query, message); | |
proc sql noprint; | |
&query; | |
quit; | |
%assertEquals(&expected, &actual); | |
%mend; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Moved to https://github.com/nicolashohm/SAS_assert