16%let fpath=%sysfunc(pathname(work))/testdir;
21%mf_mkdir(&fpath/sub1/subsub)
24%macro makefile(path,name);
26 file
"&path/&name" termstr=lf;
27 put
"This file is located at:";
29 put
"and it is called:";
36 %makefile(&path,file&x..txt)
42%spawner(&fpath/sub1/subsub)
45%mp_assertscope(SNAPSHOT)
46%mp_hashdirectory(&fpath,outds=work.hashes,maxdepth=MAX)
47%mp_assertscope(COMPARE)
52 outds=work.test_results
56 iftrue=(%mf_nobs(work.hashes)=19),
57 desc=record created
for each entry,
58 outds=work.test_results
62select count(*) into: misscheck
64 where file_hash is missing;
67 iftrue=(&misscheck=1),
68 desc=Only one missing hash - the empty directory,
69 outds=work.test_results
74 if directory=file_path then call symputx('tophash',file_hash);
78 iftrue=(%length(&tophash)=32),
79 desc=ensure valid top level hash created,
80 outds=work.test_results
85 file "&fpath/sub1/subsub/file1.txt" termstr=lf;
86 put "This file has changed!";
89%mp_hashdirectory(&fpath,outds=work.hashes2,maxdepth=MAX)
93 if directory=file_path then call symputx('tophash2',file_hash);
97 iftrue=(&tophash ne &tophash2),
98 desc=ensure the changing of the hash results in a new value,
99 outds=work.test_results
104 file "&fpath/sub1/subsub/file1.txt" termstr=lf;
105 put "This file is located at:";
106 put "&fpath/sub1/subsub";
107 put "and it is called:";
112%mp_hashdirectory(&fpath,outds=work.hashes3,maxdepth=MAX)
116 if directory=file_path then call symputx('tophash3',file_hash);
120 iftrue=(&tophash=&tophash3),
121 desc=ensure the same files result in the same hash,
122 outds=work.test_results
128 put file_hash file_path;
132 put file_hash file_path;
137%mp_hashdirectory(&fpath/doesnotexist,outds=work.hashes3,maxdepth=MAX)
141 desc=No errors when directory is missing,
142 outds=work.test_results
146 iftrue=(%mf_nobs(work.hashes3)=0),
147 desc=no records created when directory is missing,
148 outds=work.test_results