Skip to content

Commit

Permalink
Update comment and black RGBA value
Browse files Browse the repository at this point in the history
Signed-off-by: Eamonn Mansour <47121388+eamansour@users.noreply.github.com>
  • Loading branch information
eamansour committed Feb 1, 2024
1 parent 5719484 commit 9a3a520
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions pkg/images/imageExpander_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit 9a3a520

Please sign in to comment.