Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.

Commit 8b68b22

Browse files
committed
fix: Don't rewrite final images in Test_addBorders
1 parent 30ab78b commit 8b68b22

File tree

1 file changed

+1
-19
lines changed

1 file changed

+1
-19
lines changed

internal/media/ops_test.go

Lines changed: 1 addition & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ package media
33
import (
44
"bytes"
55
"crypto/sha256"
6-
"fmt"
76
"io"
87
"os"
98
"path/filepath"
@@ -118,26 +117,9 @@ func Test_addBorders(t *testing.T) {
118117
return
119118
}
120119

121-
dst, err := os.Create(filepath.Join("testdata", fmt.Sprintf("%s.jpg", tt.name)))
122-
require.NoError(t, err)
123-
124-
t.Cleanup(func() {
125-
require.NoError(t, dst.Close())
126-
})
127-
128-
buf := new(bytes.Buffer)
129-
130-
_, err = buf.ReadFrom(got)
131-
require.NoError(t, err)
132-
133-
content := buf.Bytes()
134-
135-
_, err = dst.Write(content)
136-
require.NoError(t, err)
137-
138120
want := getReaderFromPath(t, tt.want.path)
139121

140-
diff(t, want, bytes.NewReader(content))
122+
diff(t, want, got)
141123
})
142124
}
143125
}

0 commit comments

Comments
 (0)