Skip to content

Commit 6d44ba3

Browse files
committed
fixed missing edge case
1 parent c8121ca commit 6d44ba3

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

  • core/src/main/kotlin/org/evomaster/core/search/service

core/src/main/kotlin/org/evomaster/core/search/service/Sampler.kt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -152,6 +152,9 @@ abstract class Sampler<T> : TrackOperator where T : Individual {
152152
val candidates = action.getNamedExamples()
153153
//we skip named examples that are used only once
154154
.filter { it.value >= 2 }
155+
if(candidates.isEmpty()){
156+
return
157+
}
155158

156159
if (inUse.any { it.value == candidates[it.key] }) {
157160
//one example is already fully covered
@@ -160,6 +163,7 @@ abstract class Sampler<T> : TrackOperator where T : Individual {
160163

161164
//we look at something already selected, with more than 1 occurrence, and not fully used yet
162165
val options = inUse.filter { candidates.contains(it.key) }
166+
assert(options.isNotEmpty())
163167

164168
val choice = randomness.choose(options.keys)
165169

0 commit comments

Comments
 (0)