package huff import "testing" var Paths = []string{ "/content/dist/rhel/server/6/$releasever/$relarch/os", "/content/dist/rhui/server/6/$releasever/$relarch/os", "/content/beta/rhel/server/6/$releasever/$relarch/os", "/content/beta/rhel/server/7/$releasever/$relarch/os", "/content/beta/rhui/server/6/$releasever/$relarch/os", "/content/beta/rhui/server/7/$releasever/$relarch/os", } func TestWords(t *testing.T) { expected := 12 w := GetWeights(Paths, "/") t.Logf("%#v\n", w) t.Logf("%#v\n", w.Sorted()) if len(w) != expected { t.Errorf("expected %d, got %d", expected, len(w)) } }