From 9a3a520074a6a5e4080da7c0e6a65a6f003b02f1 Mon Sep 17 00:00:00 2001 From: Eamonn Mansour <47121388+eamansour@users.noreply.github.com> Date: Thu, 1 Feb 2024 14:21:09 +0000 Subject: [PATCH] Update comment and black RGBA value Signed-off-by: Eamonn Mansour <47121388+eamansour@users.noreply.github.com> --- pkg/images/imageExpander_test.go | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/pkg/images/imageExpander_test.go b/pkg/images/imageExpander_test.go index fa9ea89c..7db09313 100644 --- a/pkg/images/imageExpander_test.go +++ b/pkg/images/imageExpander_test.go @@ -21,7 +21,7 @@ import ( ) var ( - BLACK = color.RGBA{0, 0, 0, 0} + BLACK = color.RGBA{0, 0, 0, 255} ) func TestCanCalculateTargetPathsOk(t *testing.T) { @@ -179,10 +179,9 @@ func compareTwoImages(t *testing.T, renderedContents []byte, expectedContents [] expectedPixelColor := expectedImage.At(column, row) renderedPixelColor := renderedImage.At(column, row) - // We're ignoring colors here because some pixels may have slight differences in RGB values - // that aren't perceivable, causing tests to fail. - // Whenever the expected pixel is black, the rendered pixel should also be black. - // Whenever the expected pixel is a color, the rendered pixel should also be a color. + // We're ignoring colors because some pixels may have slight differences in RGB values, which + // causes tests to fail. Whenever the expected pixel is black, the rendered pixel should also + // be black, and when the expected pixel is a color, the rendered pixel should also be a color. if (expectedPixelColor == BLACK && renderedPixelColor != BLACK) || (expectedPixelColor != BLACK && renderedPixelColor == BLACK) { assert.Fail(t, "error", "rendered RGBA value %v does not match expected RGBA value %v at (x: %d, y: %d)", renderedPixelColor, expectedPixelColor, column, row)