...
1 package xgif
2
3 import (
4 _ "embed"
5 "os"
6 "testing"
7
8 "github.com/stretchr/testify/assert"
9 )
10
11
12 var test_input1 []byte
13
14
15 var test_input2 []byte
16
17
18 var test_output []byte
19
20 func TestPngToGif(t *testing.T) {
21 boards := [][]byte{test_input1, test_input2}
22 interval := 1_000
23 gifBytes, err := AnimatePNGs(boards, interval)
24 assert.NoError(t, err)
25
26
27 if false {
28 f, err := os.Create("test_output_2.gif")
29 assert.NoError(t, err)
30 defer f.Close()
31 f.Write(gifBytes)
32 }
33
34 assert.Equal(t, test_output, gifBytes)
35 }
36
View as plain text