label_test.go

 1package bug
 2
 3import (
 4	"image/color"
 5	"testing"
 6
 7	"github.com/stretchr/testify/require"
 8)
 9
10func TestLabelRGBA(t *testing.T) {
11	rgba := Label("test").RGBA()
12	expected := color.RGBA{R: 255, G: 87, B: 34, A: 255}
13
14	require.Equal(t, expected, rgba)
15}
16
17func TestLabelRGBASimilar(t *testing.T) {
18	rgba := Label("test1").RGBA()
19	expected := color.RGBA{R: 0, G: 188, B: 212, A: 255}
20
21	require.Equal(t, expected, rgba)
22}
23
24func TestLabelRGBAReverse(t *testing.T) {
25	rgba := Label("tset").RGBA()
26	expected := color.RGBA{R: 233, G: 30, B: 99, A: 255}
27
28	require.Equal(t, expected, rgba)
29}
30
31func TestLabelRGBAEqual(t *testing.T) {
32	color1 := Label("test").RGBA()
33	color2 := Label("test").RGBA()
34
35	require.Equal(t, color1, color2)
36}