actually assert something

This commit is contained in:
Vincent Batts 2014-10-02 12:00:23 -04:00
parent acf430356a
commit c742569bd0
2 changed files with 14 additions and 13 deletions

View file

@ -1,13 +1,13 @@
package huff
import (
"fmt"
"testing"
)
import "testing"
func TestNode(t *testing.T) {
// Paths defined in words_test.go
w := GetWeights(Paths, "/")
pt := NewWordTree(w.Sorted())
fmt.Printf("%#v\n", pt)
t.Logf("%#v\n", pt)
if pt == nil {
t.Error("Failed to build trie")
}
}

View file

@ -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))
}
}