Macros for SAS Application Developers
https://github.com/sasjs/core
Loading...
Searching...
No Matches
mf_dedup.test.sas
Go to the documentation of this file.
1/**
2 @file
3 @brief Testing mf_dedup macro
4
5 <h4> SAS Macros </h4>
6 @li mf_dedup.sas
7 @li mp_assert.sas
8
9**/
10
11%let str=One two one two and through and through;
12
13%mp_assert(
14 iftrue=("%mf_dedup(&str)"="One two one and through"),
15 desc=Basic test,
16 outds=work.test_results
17)
18
19%mp_assert(
20 iftrue=("%mf_dedup(&str,outdlm=%str(,))"="One,two,one,and,through"),
21 desc=Outdlm test,
22 outds=work.test_results
23)
24
25%mp_assert(
26 iftrue=("%mf_dedup(alpha|beta|gamma,indlm=%str(|))"="alpha beta gamma"),
27 desc=Input delimiter test,
28 outds=work.test_results
29)
30
31%mp_assert(
32 iftrue=("%mf_dedup(alpha|beta|alpha|gamma,indlm=%str(|))"="alpha beta gamma"),
33 desc=Input delimiter duplicate test,
34 outds=work.test_results
35)
36
37%mp_assert(
38 iftrue=("%mf_dedup(alpha|beta|alpha|gamma,indlm=%str(|),outdlm=%str(,))"
39 ="alpha,beta,gamma"),
40 desc=Input and output delimiter duplicate test,
41 outds=work.test_results
42)
43
44%mp_assert(
45 iftrue=("%mf_dedup(alpha beta gamma)"="alpha beta gamma"),
46 desc=Final unique word test,
47 outds=work.test_results
48)
49
50%mp_assert(
51 iftrue=("%mf_dedup(alpha)"="alpha"),
52 desc=Single word test,
53 outds=work.test_results
54)