From 84039c403bf56e100a414bbdd427f4c8086d124d Mon Sep 17 00:00:00 2001 From: jst Date: Sun, 10 Mar 2013 10:58:08 +0100 Subject: [PATCH] Test for correct canvas size. --- resize_test.go | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/resize_test.go b/resize_test.go index b747514..cf0fa8a 100644 --- a/resize_test.go +++ b/resize_test.go @@ -44,6 +44,15 @@ func Test_ZeroImg(t *testing.T) { } } +func Test_CorrectResize(t *testing.T) { + zeroImg := image.NewGray16(image.Rect(0,0,256,256)) + + m := Resize(60, 0, zeroImg, NearestNeighbor) + if m.Bounds() != image.Rect(0,0,60,60) { + t.Fail() + } +} + func Benchmark_BigResize(b *testing.B) { var m image.Image for i := 0; i < b.N; i++ {