Test for correct canvas size.

This commit is contained in:
jst 2013-03-10 10:58:08 +01:00
parent b6fef854bc
commit 84039c403b
1 changed files with 9 additions and 0 deletions

View File

@ -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++ {