From ecf4757809584c021847db5955683e0dbdb08a02 Mon Sep 17 00:00:00 2001 From: Hajime Hoshi Date: Fri, 2 Mar 2018 02:56:53 +0900 Subject: [PATCH] graphics: Add TestImageSize --- image_test.go | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/image_test.go b/image_test.go index 75e5f1a28..a1cadcbc3 100644 --- a/image_test.go +++ b/image_test.go @@ -693,6 +693,21 @@ func TestImageOutsideUpperLeft(t *testing.T) { } } +func TestImageSize(t *testing.T) { + const ( + w = 17 + h = 31 + ) + img, _ := NewImage(w, h, FilterDefault) + gotW, gotH := img.Size() + if gotW != w { + t.Errorf("got: %d, want: %d", gotW, w) + } + if gotH != h { + t.Errorf("got: %d, want: %d", gotH, h) + } +} + func TestImageSize1(t *testing.T) { src, _ := NewImage(1, 1, FilterNearest) dst, _ := NewImage(1, 1, FilterNearest)