MCPcopy Create free account
hub / github.com/TheAlgorithms/Go / TestRGBToHEX

Function TestRGBToHEX

conversion/rgbhex_test.go:35–45  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

33}
34
35func TestRGBToHEX(t *testing.T) {
36 for i := 0; i < len(RGB); i++ {
37 args := RGB[i]
38 expected := HEX[i]
39 result := RGBToHEX(args[0], args[1], args[2])
40 if result != expected {
41 t.Errorf("RGBToHEX(%d,%d,%d) = %d; want %d",
42 args[0], args[1], args[2], result, expected)
43 }
44 }
45}
46
47func BenchmarkRGBToHEX(b *testing.B) {
48 for i := 0; i < b.N; i++ {

Callers

nothing calls this directly

Calls 1

RGBToHEXFunction · 0.85

Tested by

no test coverage detected