Skip to content

Commit

Permalink
fix: Don't rewrite final images in Test_addBorders
Browse files Browse the repository at this point in the history
  • Loading branch information
obalunenko committed Jan 4, 2023
1 parent 30ab78b commit 8b68b22
Showing 1 changed file with 1 addition and 19 deletions.
20 changes: 1 addition & 19 deletions internal/media/ops_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ package media
import (
"bytes"
"crypto/sha256"
"fmt"
"io"
"os"
"path/filepath"
Expand Down Expand Up @@ -118,26 +117,9 @@ func Test_addBorders(t *testing.T) {
return
}

dst, err := os.Create(filepath.Join("testdata", fmt.Sprintf("%s.jpg", tt.name)))
require.NoError(t, err)

t.Cleanup(func() {
require.NoError(t, dst.Close())
})

buf := new(bytes.Buffer)

_, err = buf.ReadFrom(got)
require.NoError(t, err)

content := buf.Bytes()

_, err = dst.Write(content)
require.NoError(t, err)

want := getReaderFromPath(t, tt.want.path)

diff(t, want, bytes.NewReader(content))
diff(t, want, got)
})
}
}
Expand Down

0 comments on commit 8b68b22

Please sign in to comment.