13%mp_assertscope(SNAPSHOT)
14%let x=%mf_wordsinstr1butnotstr2(str1=xx DOLLAR x $CHAR xxx W MONNAME
15 ,str2=ff xx x xxx xxxxxx
17%mp_assertscope(COMPARE,ignorelist=x)
21 "&x"=
"DOLLAR $CHAR W MONNAME"
23 desc=Checking basic
string,
24 outds=work.test_results
30 "%mf_wordsinstr1butnotstr2(str1=var1 var10 var100,str2=var1)"
33 desc=Checking word boundaries,
34 outds=work.test_results
40 "%mf_wordsinstr1butnotstr2(str1=DOLLAR dollar,str2=DOLLAR)"=
"dollar"
42 desc=Checking
case sensitivity,
43 outds=work.test_results
49 "%mf_wordsinstr1butnotstr2(str1=a a b a,str2=b)"=
"a a a"
51 desc=Checking duplicate words,
52 outds=work.test_results
58 "%mf_wordsinstr1butnotstr2(str1=a b,str2=b a)"=
""
60 desc=Checking empty result,
61 outds=work.test_results
67 "%mf_wordsinstr1butnotstr2(str1=,str2=a b)"=
""
69 desc=Checking empty str1,
70 outds=work.test_results
76 "%mf_wordsinstr1butnotstr2(str1=a b c,str2=)"=
"a b c"
78 desc=Checking empty str2 returns all words,
79 outds=work.test_results
85 length str1 str2 expected $32767;
88 str1=catx(' ',str1,word);
89 if mod(i,10)=0 then str2=catx(' ',str2,word);
90 else expected=catx(' ',expected,word);
92 call symputx('str1',str1);
93 call symputx('str2',str2);
94 call symputx('expected',expected);
97%mp_assertscope(SNAPSHOT)
98%let result=%mf_wordsinstr1butnotstr2(str1=&str1,str2=&str2);
99%mp_assertscope(COMPARE,ignorelist=result)
101%let count=%sysfunc(countw(&result));
107 desc=Checking 1000 variable
string returns 900 words,
108 outds=work.test_results
113 "&result"="&expected"
115 desc=Checking 1000 variable
string content,
116 outds=work.test_results