From 76c74bcd0bbb2c06d44e16e699531b19b92c6cc8 Mon Sep 17 00:00:00 2001 From: qeesung <1245712564@qq.com> Date: Tue, 23 Oct 2018 00:30:20 +0800 Subject: [PATCH] Add if colored the char test --- ascii/ascii_test.go | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/ascii/ascii_test.go b/ascii/ascii_test.go index 741d0b4..c2e7161 100644 --- a/ascii/ascii_test.go +++ b/ascii/ascii_test.go @@ -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} -- 2.45.2