Skip to content

Commit

Permalink
Passing IM error up the stack
Browse files Browse the repository at this point in the history
  • Loading branch information
dooman87 committed Aug 15, 2024
1 parent 2d6f5f3 commit 574dd3e
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions img/processor/imagemagick_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import (
"path/filepath"
"reflect"
"strconv"
"strings"
"testing"
)

Expand Down Expand Up @@ -706,9 +707,9 @@ func TestOptimise_ErrorIdentify(t *testing.T) {
t.Error("expected error but got none")
}

expectedError := "Error executing identify command: exit status 1\nStderr: [identify: no decode delegate for this image format `' @ error/constitute.c/ReadImage/746.]"
if err.Error() != expectedError {
t.Errorf("expected error %s, but got %s", expectedError, err.Error())
expectedError := "identify: no decode delegate for this image format"
if !strings.Contains(err.Error(), expectedError) {
t.Errorf("expected error to contain [%s], but got [%s]", expectedError, err.Error())
}
}

Expand Down Expand Up @@ -741,8 +742,8 @@ func TestOptimise_ErrorConvert(t *testing.T) {
t.Error("expected error but got none")
}

expectedError := "Error executing convert command: exit status 1\nStderr: [convert: unrecognized option `-i_dont_know' @ error/convert.c/ConvertImageCommand/1965.]"
if err.Error() != expectedError {
t.Errorf("expected error %s, but got %s", expectedError, err.Error())
expectedError := "unrecognized option `-i_dont_know'"
if !strings.Contains(err.Error(), expectedError) {
t.Errorf("expected error to contain [%s], but got [%s]", expectedError, err.Error())
}
}

0 comments on commit 574dd3e

Please sign in to comment.