Skip to content

Commit 919df0f

Browse files
committed
Merge branch 'master' of github.com:grails/grails-core
2 parents a4939b1 + d7445c4 commit 919df0f

File tree

1 file changed

+15
-1
lines changed

1 file changed

+15
-1
lines changed

src/java/org/codehaus/groovy/grails/test/support/GrailsTestTypeSupport.groovy

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff 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

0 commit comments

Comments
 (0)