File tree Expand file tree Collapse file tree 1 file changed +15
-1
lines changed
src/java/org/codehaus/groovy/grails/test/support Expand file tree Collapse file tree 1 file changed +15
-1
lines changed Original file line number Diff line number Diff line change @@ -171,9 +171,23 @@ abstract class GrailsTestTypeSupport implements GrailsTestType {
171171 suffixes. each { suffix ->
172172 testExtensions. each { extension ->
173173 def resources = resolveResources(" file:${ sourceDir.absolutePath} /${ targetPattern.filePattern}${ suffix} .${ extension} " . toString())
174- sourceFiles. addAll(resources* . file. findAll { it. exists() }. toList())
174+
175+ def matches = resources* . file. findAll { file ->
176+ if (! file. exists()) {
177+ false
178+ } else if (suffix == " " ) {
179+ // Because we searched with an empty suffix to cater for patterns containing the suffix (or part thereof),
180+ // we need to filter out any matches that don't actually match any of the valid suffixes
181+ testSuffixes. any { realSuffix -> file. name. endsWith(" ${ realSuffix} .${ extension} " ) }
182+ } else {
183+ true
184+ }
185+ }
186+
187+ sourceFiles. addAll(matches. toList())
175188 }
176189 }
190+
177191 sourceFiles. unique()
178192 }
179193
You can’t perform that action at this time.
0 commit comments