diff --git a/internal/thumb/open_jpeg_test.go b/internal/thumb/open_jpeg_test.go index cfa52fe22..15b7da38c 100644 --- a/internal/thumb/open_jpeg_test.go +++ b/internal/thumb/open_jpeg_test.go @@ -35,4 +35,11 @@ func TestOpenJpeg(t *testing.T) { t.Error("img must not be nil") } }) + t.Run("filename empty", func(t *testing.T) { + img, err := OpenJpeg("", 0) + + assert.Error(t, err) + assert.Equal(t, "filename missing", err.Error()) + assert.Nil(t, img) + }) } diff --git a/internal/thumb/quality_test.go b/internal/thumb/quality_test.go index 4361e9f4f..ea1feef67 100644 --- a/internal/thumb/quality_test.go +++ b/internal/thumb/quality_test.go @@ -81,3 +81,10 @@ func TestParseQuality(t *testing.T) { assert.Equal(t, Quality(100), ParseQuality("100")) }) } + +func TestQuality_String(t *testing.T) { + assert.Equal(t, "95", QualityBest.String()) + assert.Equal(t, "92", QualityHigh.String()) + assert.Equal(t, "75", QualityBad.String()) + +}