HMS-Analytical-Software / SASUnit

SASUnit is a unit testing framework for SAS(TM)-programs. It can be used for the development, execution and automatic documentation of tests for SAS programs.
GNU Lesser General Public License v3.0
2 stars 0 forks source link

Make SASUnit usable in a data step #4

Open SamuelMelm opened 1 year ago

SamuelMelm commented 1 year ago

It should be possible to run assertions in data steps. This could be done with PROC FCMP or maybe also with macro programs (Andreas Menrath).


Originally created on SourceForge by amangold - 15.07.2012, 23:26

SamuelMelm commented 1 year ago

It should be possible to use PROC FCMP in any test scenario. Where else should it be used?


Originally created on SourceForge by amangold - 15.07.2012, 23:36

SamuelMelm commented 1 year ago

The idea was to create a generic ASSERT-Function or SubRoutine with Proc FCMP which can interact with SASUnit.

That ASSERT function could verify any valid SAS expression and fail a unit test if the expression resolves to false.

example for usage:

data null;

x = \<my datalogic to test>;

assert(x = 42);

/* if (x=42) resolves to true then the test is passed else failed */

run;


Originally created on SourceForge by menrath - 16.07.2012, 12:45

SamuelMelm commented 1 year ago

see also ticket #29 https://sourceforge.net/p/sasunit/bugs/29/


Originally created on SourceForge by menrath - 16.07.2012, 13:03

SamuelMelm commented 1 year ago

Diff:


--- old
+++ new
@@ -1 +1 @@
-Use PROC FCMP in SASUnit (Andreas Menrath).
+It should be possible to run assertions in data steps. This could be done with PROC FCMP or maybe also with macro programs (Andreas Menrath).

Originally created on SourceForge by amangold - 24.07.2012, 12:06