(t *testing.T)
| 15 | } |
| 16 | |
| 17 | func TestHEXToRGB(t *testing.T) { |
| 18 | for i := 0; i < len(HEX); i++ { |
| 19 | hex := HEX[i] |
| 20 | expected := RGB[i] |
| 21 | resultR, resultG, resultB := HEXToRGB(hex) |
| 22 | if resultR != expected[0] || resultG != expected[1] || resultB != expected[2] { |
| 23 | t.Errorf("HEXToRGB(%d) = %d,%d,%d; want %d,%d,%d", |
| 24 | hex, resultR, resultG, resultB, expected[0], expected[1], expected[2]) |
| 25 | } |
| 26 | } |
| 27 | } |
| 28 | |
| 29 | func BenchmarkHEXToRGB(b *testing.B) { |
| 30 | for i := 0; i < b.N; i++ { |
nothing calls this directly
no test coverage detected