Commit 0de5f251 authored by santiaago's avatar santiaago
Browse files

refactor vars

parent bd04e473
Loading
Loading
Loading
Loading
+6 −12
Original line number Diff line number Diff line
@@ -5,15 +5,17 @@ import (
	"testing"
)

func TestRandomColorFromArrayWithFreq(t *testing.T) {

	c1 := color.RGBA{255, 245, 249, 255}
	colors := []color.RGBA{
var (
	c1     = color.RGBA{255, 245, 249, 255}
	colors = []color.RGBA{
		c1,
		color.RGBA{232, 70, 134, 255},
		color.RGBA{232, 70, 186, 255},
		color.RGBA{232, 70, 81, 255},
	}
)

func TestRandomColorFromArrayWithFreq(t *testing.T) {

	if c := RandomColorFromArrayWithFreq(colors, 0); c == c1 {
		t.Errorf("expected color different than", c1, "got", c)
@@ -26,14 +28,6 @@ func TestRandomColorFromArrayWithFreq(t *testing.T) {

func TestRandomColorArray(t *testing.T) {

	c1 := color.RGBA{255, 245, 249, 255}
	colors := []color.RGBA{
		c1,
		color.RGBA{232, 70, 134, 255},
		color.RGBA{232, 70, 186, 255},
		color.RGBA{232, 70, 81, 255},
	}

	if c := RandomColorFromArray(colors); !contains(colors, c) {
		t.Errorf("expected color in array", colors, "got", c)
	}