Compare commits
1
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
afb5dc5d0d |
@@ -19,11 +19,17 @@ import (
|
||||
func TestImageProxyRefusesFitOutsideAboveMaximum(t *testing.T) {
|
||||
t.Parallel()
|
||||
|
||||
// The sources, by their upstream paths
|
||||
// The upstream paths of the sources
|
||||
const (
|
||||
widePath = "/wide.png"
|
||||
rowPath = "/row.png"
|
||||
columnPath = "/column.png"
|
||||
)
|
||||
|
||||
sources := map[string][]byte{
|
||||
"/wide.png": encodeTestPNG(t, 3000, 600),
|
||||
"/row.png": encodeTestPNG(t, 8192, 1),
|
||||
"/column.png": encodeTestPNG(t, 1, 8192),
|
||||
widePath: encodeTestPNG(t, 3000, 600),
|
||||
rowPath: encodeTestPNG(t, 8192, 1),
|
||||
columnPath: encodeTestPNG(t, 1, 8192),
|
||||
}
|
||||
|
||||
upstream := httptest.NewServer(http.HandlerFunc(
|
||||
@@ -46,10 +52,10 @@ func TestImageProxyRefusesFitOutsideAboveMaximum(t *testing.T) {
|
||||
// wantWidth and wantHeight are the served image's, 0 for a refusal
|
||||
wantWidth, wantHeight int
|
||||
}{
|
||||
{"/wide.png", 1, 8192, 0, 0},
|
||||
{"/row.png", 1, 8192, 0, 0},
|
||||
{"/column.png", 8192, 1, 0, 0},
|
||||
{"/wide.png", 1, 1200, 6000, 1200},
|
||||
{widePath, 1, 8192, 0, 0},
|
||||
{rowPath, 1, 8192, 0, 0},
|
||||
{columnPath, 8192, 1, 0, 0},
|
||||
{widePath, 1, 1200, 6000, 1200},
|
||||
}
|
||||
|
||||
for _, tt := range tests {
|
||||
|
||||
Reference in new issue
Block a user