mirror of
https://git.sr.ht/~eliasnaur/gio
synced 2026-07-01 07:35:40 +00:00
cmd/gogio: use a more difficult color for end-to-end tests
RGB 0xff0000 is too easy to get right by accident. Signed-off-by: Elias Naur <mail@eliasnaur.com>
This commit is contained in:
@@ -127,8 +127,8 @@ func TestJSOnChrome(t *testing.T) {
|
||||
t.Fatalf("expected dimensions to be %d*%d, got %d*%d",
|
||||
wantSize, wantSize, size.X, size.Y)
|
||||
}
|
||||
wantColor(t, img, 5, 5, 0xffff, 0x0, 0x0)
|
||||
wantColor(t, img, 595, 595, 0xffff, 0x0, 0x0)
|
||||
wantColor(t, img, 5, 5, 0xdede, 0xadad, 0xbebe)
|
||||
wantColor(t, img, 595, 595, 0xdede, 0xadad, 0xbebe)
|
||||
}
|
||||
|
||||
func wantColor(t *testing.T, img image.Image, x, y int, r, g, b uint32) {
|
||||
|
||||
Vendored
+1
-1
@@ -25,7 +25,7 @@ func main() {
|
||||
}
|
||||
|
||||
func loop(w *app.Window) error {
|
||||
background := color.RGBA{255, 0, 0, 255}
|
||||
background := color.RGBA{R: 0xde, G: 0xad, B: 0xbe, A: 0xff}
|
||||
ops := new(op.Ops)
|
||||
for {
|
||||
e := <-w.Events()
|
||||
|
||||
@@ -170,7 +170,7 @@ func TestX11(t *testing.T) {
|
||||
t.Fatalf("expected dimensions to be %d*%d, got %d*%d",
|
||||
wantSize, wantSize, size.X, size.Y)
|
||||
}
|
||||
wantColor(t, img, 5, 5, 0xffff, 0x0, 0x0)
|
||||
wantColor(t, img, 595, 595, 0xffff, 0x0, 0x0)
|
||||
wantColor(t, img, 5, 5, 0xdede, 0xadad, 0xbebe)
|
||||
wantColor(t, img, 595, 595, 0xdede, 0xadad, 0xbebe)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user