huff/words_test.go

23 lines
600 B
Go
Raw Permalink Normal View History

2014-04-13 23:53:47 +00:00
package huff
2014-10-02 16:00:23 +00:00
import "testing"
2014-04-13 23:53:47 +00:00
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) {
2014-10-02 16:00:23 +00:00
expected := 12
2014-04-13 23:53:47 +00:00
w := GetWeights(Paths, "/")
2014-10-02 16:00:23 +00:00
t.Logf("%#v\n", w)
t.Logf("%#v\n", w.Sorted())
if len(w) != expected {
t.Errorf("expected %d, got %d", expected, len(w))
}
2014-04-13 23:53:47 +00:00
}