Sfoglia il codice sorgente

Test for correct canvas size.

jst 13 anni fa
parent
commit
84039c403b
1 ha cambiato i file con 9 aggiunte e 0 eliminazioni
  1. 9 0
      resize_test.go

+ 9 - 0
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++ {