~dricottone/image2ascii

76c74bcd0bbb2c06d44e16e699531b19b92c6cc8 — qeesung 6 years ago a560de5
Add if colored the char test
1 files changed, 15 insertions(+), 0 deletions(-)

M ascii/ascii_test.go
M ascii/ascii_test.go => ascii/ascii_test.go +15 -0
@@ 80,6 80,21 @@ func TestConvertPixelToASCIIBlackColor(t *testing.T) {
		fmt.Sprintf("Reverse Black color chould be converted to %s", string([]byte{lastPixelChar})))
}

func TestColoredASCIIChar(t *testing.T) {
	assertions := assert.New(t)
	r, g, b, a := uint8(123), uint8(123), uint8(123), uint8(255)
	pixel := color.RGBA{
		R: r,
		G: g,
		B: b,
		A: a,
	}
	defaultOptions := NewOptions()
	defaultOptions.Colored = true
	coloredChar := ConvertPixelToASCII(pixel, &defaultOptions)
	assertions.True(len(coloredChar) > 1)
}

// TestReverseSlice test reverse a slice
func TestReverseSlice(t *testing.T) {
	s := []byte{1, 2, 3, 4, 5}