@@ -73,6 +73,21 @@ func TestCopyFolderWithTechnologyFiltering(t *testing.T) {
7373 assertFileExists (t , fs , filepath .Join (targetDir , "fileB1.txt" ))
7474 assertFileNotExists (t , fs , filepath .Join (targetDir , "fileC1.txt" ))
7575 })
76+ t .Run ("copy with multiple technology filter with whitespace" , func (t * testing.T ) {
77+ t .Cleanup (func () {
78+ _ = fs .RemoveAll (targetDir )
79+ _ = fs .MkdirAll (targetDir , 0755 )
80+ })
81+
82+ technology := "java, python"
83+ err := CopyByTechnology (testLog , fs , sourceDir , targetDir , technology )
84+ require .NoError (t , err )
85+
86+ assertFileExists (t , fs , filepath .Join (targetDir , "fileA1.txt" ))
87+ assertFileExists (t , fs , filepath .Join (targetDir , "fileA2.txt" ))
88+ assertFileExists (t , fs , filepath .Join (targetDir , "fileB1.txt" ))
89+ assertFileNotExists (t , fs , filepath .Join (targetDir , "fileC1.txt" ))
90+ })
7691 t .Run ("copy with invalid technology filter" , func (t * testing.T ) {
7792 t .Cleanup (func () {
7893 _ = fs .RemoveAll (targetDir )
@@ -192,6 +207,15 @@ func TestFilterFilesByTechnology(t *testing.T) {
192207 filepath .Join ("fileB1.txt" ),
193208 }, paths )
194209 })
210+ t .Run ("filter multiple technologies with white spaces" , func (t * testing.T ) {
211+ paths , err := filterFilesByTechnology (testLog , fs , sourceDir , []string {"java " , " python " })
212+ require .NoError (t , err )
213+ assert .ElementsMatch (t , []string {
214+ filepath .Join ("fileA1.txt" ),
215+ filepath .Join ("fileA2.txt" ),
216+ filepath .Join ("fileB1.txt" ),
217+ }, paths )
218+ })
195219 t .Run ("not filter non-existing technology" , func (t * testing.T ) {
196220 paths , err := filterFilesByTechnology (testLog , fs , sourceDir , []string {"php" })
197221 require .NoError (t , err )
0 commit comments