Skip to content

Commit 137db6b

Browse files
committed
Initialize inner gene for back reference gene during sampling for tests.
1 parent 6f3329a commit 137db6b

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

core/src/test/kotlin/org/evomaster/core/search/gene/GeneSamplerForTests.kt

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -406,9 +406,12 @@ object GeneSamplerForTests {
406406
}
407407

408408
fun sampleBackReferenceRxGene(rand: Randomness): BackReferenceRxGene {
409+
val captureGroup = sampleDisjunctionListRxGene(rand)
410+
// as we do not allow to mutate the inner captureGroup gene using the backref gene we must first initialize it
411+
captureGroup.doInitialize(rand)
409412
return BackReferenceRxGene(
410413
groupIndex = rand.nextInt(1, 99),
411-
captureGroup = sampleDisjunctionListRxGene(rand)
414+
captureGroup = captureGroup
412415
)
413416
}
414417

0 commit comments

Comments
 (0)