summaryrefslogtreecommitdiff
path: root/src/pkg/image/image_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'src/pkg/image/image_test.go')
-rw-r--r--src/pkg/image/image_test.go5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/pkg/image/image_test.go b/src/pkg/image/image_test.go
index 5469d6423..a368e71e6 100644
--- a/src/pkg/image/image_test.go
+++ b/src/pkg/image/image_test.go
@@ -72,6 +72,11 @@ func TestImage(t *testing.T) {
t.Errorf("%T: sub-image at (3, 3), want a non-zero color, got %v", m, m.At(3, 3))
continue
}
+ // Test that taking an empty sub-image starting at a corner does not panic.
+ m.SubImage(Rect(0, 0, 0, 0))
+ m.SubImage(Rect(10, 0, 10, 0))
+ m.SubImage(Rect(0, 10, 0, 10))
+ m.SubImage(Rect(10, 10, 10, 10))
}
}