mirror of
https://github.com/willnorris/imageproxy.git
synced 2026-05-23 10:55:12 +02:00
add test for trimEdges function with empty image
This commit is contained in:
parent
5a66c793b9
commit
493fe180d3
1 changed files with 16 additions and 0 deletions
|
|
@ -539,3 +539,19 @@ func TestTrimEdgesUneven(t *testing.T) {
|
||||||
t.Errorf("trimEdges() pixel data does not match expected result")
|
t.Errorf("trimEdges() pixel data does not match expected result")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func TestTrimEdgesEmptyImage(t *testing.T) {
|
||||||
|
// Create an empty image (0x0 dimensions)
|
||||||
|
src := newImage(0, 0)
|
||||||
|
|
||||||
|
// The expected result should also be an empty image
|
||||||
|
want := src
|
||||||
|
|
||||||
|
// Apply the trimEdges function
|
||||||
|
got := trimEdges(src)
|
||||||
|
|
||||||
|
// Compare pixel data
|
||||||
|
if !compareImages(got, want) {
|
||||||
|
t.Errorf("trimEdges() for empty image returned %v, want %v", got.Bounds(), want.Bounds())
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue