issue 1440: the plain-lid test's specks lie where counting them would make a box

This commit is contained in:
2026-10-20 20:10:29 +02:00
parent cf407f187d
commit 26ae4d2fd8
+2 -2
View File
@@ -10,13 +10,13 @@ import (
"testing"
)
// lidWhite is a w x h gray image of the lid's white, with a few specks of dust.
// lidWhite is a w x h gray image of the lid's white, with a few specks of dust in one patch.
func lidWhite(w, h int, seed int64) *image.Gray {
g := image.NewGray(image.Rect(0, 0, w, h))
draw.Draw(g, g.Bounds(), &image.Uniform{color.Gray{255}}, image.Point{}, draw.Src)
r := rand.New(rand.NewSource(seed))
for i := 0; i < 40; i++ {
g.SetGray(r.Intn(w), r.Intn(h), color.Gray{120})
g.SetGray(100+r.Intn(w/4), 100+r.Intn(h/4), color.Gray{120}) // all in one patch, so counting them would make a box
}
return g
}