mirror of
https://github.com/MichaelMure/git-bug.git
synced 2024-12-14 17:51:44 +03:00
random bugs: fix a crash when minOps == maxOps
This commit is contained in:
parent
60fcfcdcb0
commit
27c5ea5b5b
@ -72,7 +72,12 @@ func GenerateRandomBugsWithSeed(opts Options, seed int64) []*bug.Bug {
|
||||
panic(err)
|
||||
}
|
||||
|
||||
nOps := opts.MinOp + rand.Intn(opts.MaxOp-opts.MinOp)
|
||||
nOps := opts.MinOp
|
||||
|
||||
if opts.MaxOp > opts.MinOp {
|
||||
nOps += rand.Intn(opts.MaxOp - opts.MinOp)
|
||||
}
|
||||
|
||||
for j := 0; j < nOps; j++ {
|
||||
index := rand.Intn(len(opsGenerators))
|
||||
opsGenerators[index](b, randomPerson(opts.PersonNumber))
|
||||
|
Loading…
Reference in New Issue
Block a user