From d245b80c6540fffcf3f3df2fbc53bd19532fe11f Mon Sep 17 00:00:00 2001 From: Antoine Aflalo <197810+Belphemur@users.noreply.github.com> Date: Wed, 3 Sep 2025 22:21:03 -0400 Subject: [PATCH] fix: naming issue --- pkg/converter/webp/webp_converter_test.go | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/pkg/converter/webp/webp_converter_test.go b/pkg/converter/webp/webp_converter_test.go index 48ba729..b383b16 100644 --- a/pkg/converter/webp/webp_converter_test.go +++ b/pkg/converter/webp/webp_converter_test.go @@ -295,15 +295,16 @@ func TestConverter_convertPage(t *testing.T) { } } -func TestConverter_convertPage_WithCorruptedImage(t *testing.T) { +func TestConverter_convertPage_EncodingError(t *testing.T) { converter := New() err := converter.PrepareConverter() require.NoError(t, err) - // Create a corrupted PNG image by creating a page with invalid data + // Create a test case with nil image to test encoding error path + // when isToBeConverted is true but the image is nil, simulating a failure in the encoding step corruptedPage := &manga.Page{ Index: 1, - Contents: &bytes.Buffer{}, // Empty buffer - should cause decode error + Contents: &bytes.Buffer{}, // Empty buffer Extension: ".png", Size: 0, } @@ -312,7 +313,7 @@ func TestConverter_convertPage_WithCorruptedImage(t *testing.T) { converted, err := converter.convertPage(container, 80) - // This should return nil container and error because decode will fail with "image: unknown format" + // This should return nil container and error because encoding will fail with nil image assert.Error(t, err) assert.Nil(t, converted) }