1
0
Fork 0
mirror of https://github.com/vbatts/go-mtree.git synced 2024-11-25 09:35:39 +00:00
go-mtree/walk_test.go

36 lines
541 B
Go
Raw Normal View History

package mtree
import (
"io/ioutil"
"testing"
)
func TestWalk(t *testing.T) {
dh, err := Walk(".", nil, append(DefaultKeywords, "sha1"))
if err != nil {
t.Fatal(err)
}
//log.Fatalf("%#v", dh)
fh, err := ioutil.TempFile("", "walk.")
if err != nil {
t.Fatal(err)
}
if _, err = dh.WriteTo(fh); err != nil {
t.Error(err)
}
fh.Close()
t.Fatal(fh.Name())
//os.Remove(fh.Name())
}
func TestReadNames(t *testing.T) {
names, err := readOrderedDirNames(".")
if err != nil {
t.Error(err)
}
t.Errorf("names: %q", names)
}