actually assert something
This commit is contained in:
parent
acf430356a
commit
c742569bd0
2 changed files with 14 additions and 13 deletions
|
@ -1,13 +1,13 @@
|
|||
package huff
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"testing"
|
||||
)
|
||||
import "testing"
|
||||
|
||||
func TestNode(t *testing.T) {
|
||||
// Paths defined in words_test.go
|
||||
// Paths defined in words_test.go
|
||||
w := GetWeights(Paths, "/")
|
||||
pt := NewWordTree(w.Sorted())
|
||||
fmt.Printf("%#v\n", pt)
|
||||
pt := NewWordTree(w.Sorted())
|
||||
t.Logf("%#v\n", pt)
|
||||
if pt == nil {
|
||||
t.Error("Failed to build trie")
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,9 +1,6 @@
|
|||
package huff
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"testing"
|
||||
)
|
||||
import "testing"
|
||||
|
||||
var Paths = []string{
|
||||
"/content/dist/rhel/server/6/$releasever/$relarch/os",
|
||||
|
@ -15,7 +12,11 @@ var Paths = []string{
|
|||
}
|
||||
|
||||
func TestWords(t *testing.T) {
|
||||
expected := 12
|
||||
w := GetWeights(Paths, "/")
|
||||
fmt.Printf("%#v\n", w)
|
||||
fmt.Printf("%#v\n", w.Sorted())
|
||||
t.Logf("%#v\n", w)
|
||||
t.Logf("%#v\n", w.Sorted())
|
||||
if len(w) != expected {
|
||||
t.Errorf("expected %d, got %d", expected, len(w))
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue