77end
88
99function test_removeDateSuffixBasic()
10-
10+
1111 outputDir = pwd ;
12-
12+
1313 createFiles = 0 ;
1414 testDo = 1 ;
15-
15+
1616 %% set up
1717 boldName = ' test_bold_date-202008050730.nii.gz' ;
1818 boldName2 = ' test2_bold.nii.gz' ;
@@ -21,7 +21,7 @@ function test_removeDateSuffixBasic()
2121 eventsName = ' test_events_date-202008050730.tsv' ;
2222 stimName = ' test_stim_date-202008050730.tsv' ;
2323 stimNameZipped = ' test2_stim_date-202008050730.tsv.gz' ;
24-
24+
2525 filesToProcess = { ...
2626 boldName ;
2727 boldName2 ;
@@ -31,16 +31,15 @@ function test_removeDateSuffixBasic()
3131 stimName ;
3232 stimNameZipped ;
3333 };
34-
34+
3535 % create new files for new tests
3636 for iFile = 1 : numel(filesToProcess )
3737 system(sprintf(' touch %s ' , filesToProcess{iFile }));
3838 end
39-
40-
39+
4140 %% do stuff
4241 filenames = file_utils(' List' , outputDir , ' ^test.*$' );
43-
42+
4443 %% expected data
4544 expectedBoldName = ' test_bold.nii.gz' ;
4645 expectedBoldName2 = ' test2_bold.nii.gz' ;
@@ -49,9 +48,9 @@ function test_removeDateSuffixBasic()
4948 expectedEventsName = ' test_events.tsv' ;
5049 expectedStimName = ' test_stim.tsv' ;
5150 expectedStimNameZipped = ' test2_stim.tsv.gz' ;
52-
51+
5352 removeDateSuffix(filenames , outputDir );
54-
53+
5554 %% test
5655 fprintf(1 , fullfile(outputDir , expectedBoldName3 ));
5756 assertEqual(exist(fullfile(outputDir , expectedBoldName3 ), ' file' ), 2 );
@@ -62,10 +61,10 @@ function test_removeDateSuffixBasic()
6261 assertEqual(exist(fullfile(outputDir , expectedStimNameZipped ), ' file' ), 2 );
6362 assertEqual(exist(fullfile(outputDir , expectedBoldName2 ), ' file' ), 2 );
6463 assertEqual(exist(fullfile(outputDir , expectedBoldName ), ' file' ), 2 );
65-
64+
6665 % clean up
67- delete(' *.nii*' )
68- delete(' *.tsv*' )
69- delete(' *.json' )
70-
66+ delete(' *.nii*' );
67+ delete(' *.tsv*' );
68+ delete(' *.json' );
69+
7170end
0 commit comments