package main import ( "image/color" "testing" ) // The built-in back arrow must leave the label band (bottom third) untouched // and actually draw something above it. func TestBackArrowLayout(t *testing.T) { img := backArrow(96, 96, color.White) lit := 0 for y := 0; y < 64; y++ { for x := 0; x < 96; x++ { if r, _, _, _ := img.At(x, y).RGBA(); r > 0 { lit++ } } } if lit < 200 { t.Errorf("arrow region has only %d lit pixels", lit) } for y := 72; y < 96; y++ { for x := 0; x < 96; x++ { if r, _, _, _ := img.At(x, y).RGBA(); r > 0 { t.Fatalf("label band pixel (%d,%d) is lit", x, y) } } } }