hlctl/ctllog/colors_test.go

23 lines
421 B
Go

package ctllog
import (
"testing"
// "sectorinf.com/emilis/hlctl/ctllog"
)
func TestColorFromHex(t *testing.T) {
testCases := map[string]ColorRGB{
"000000": {},
"0c2238": {12, 34, 56},
}
for hexColor, expected := range testCases {
t.Run(hexColor, func(t *testing.T) {
actual := ColorRGB{}.FromHex(hexColor)
if expected != actual {
t.Fatalf("expected %+v got %+v", expected, actual)
}
})
}
}