summaryrefslogtreecommitdiffstats
path: root/colorschemes/registry_test.go
blob: 3f288d18af9fdeab1f7ee87f07258e20db290046 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
package colorschemes

import (
	"github.com/shibukawa/configdir"
	"path/filepath"
	"reflect"
	"testing"
)

func TestColorRegistry(t *testing.T) {
	colors := []string{"default", "default-dark", "solarized", "solarized16-dark", "solarized16-light", "monokai", "vice"}
	zeroCS := Colorscheme{}
	cd := configdir.New("", "gotop")
	cd.LocalPath, _ = filepath.Abs(".")
	for _, cn := range colors {
		c, e := FromName(cd, cn)
		if e != nil {
			t.Errorf("unexpected error fetching built-in color %s: %s", cn, e)
		}
		if reflect.DeepEqual(c, zeroCS) {
			t.Error("expected a colorscheme, but got back a zero value.")
		}
	}
}