Skip to content

Commit

Permalink
add test with options
Browse files Browse the repository at this point in the history
  • Loading branch information
logica0419 committed Aug 31, 2024
1 parent 57bd6fb commit 6a6a553
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions resigif_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import (
"github.com/logica0419/resigif/testdata"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
"golang.org/x/image/draw"
)

var overWrite = flag.Bool("overwrite", false, "overwrite test file")
Expand Down Expand Up @@ -72,7 +73,9 @@ func TestResize(t *testing.T) {
src: "mushroom.gif",
width: 256,
height: 256,
opts: nil,
opts: []resigif.Option{
resigif.WithAspectRatio(resigif.Ignore),
},
},
want: "mushroom_resized.gif",
assertion: require.NoError,
Expand All @@ -84,7 +87,9 @@ func TestResize(t *testing.T) {
src: "tooth.gif",
width: 256,
height: 256,
opts: nil,
opts: []resigif.Option{
resigif.WithParallel(1),
},
},
want: "tooth_resized.gif",
assertion: require.NoError,
Expand All @@ -96,7 +101,9 @@ func TestResize(t *testing.T) {
src: "new_year.gif",
width: 256,
height: 256,
opts: nil,
opts: []resigif.Option{
resigif.WithImageResizeFunc(resigif.FromDrawScaler(draw.BiLinear)),
},
},
want: "new_year_resized.gif",
assertion: require.NoError,
Expand Down
Binary file modified testdata/new_year_resized.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 6a6a553

Please sign in to comment.