zk/util/paths/walk_test.go
2021-01-10 16:39:10 +01:00

29 lines
507 B
Go

package paths
import (
"testing"
"github.com/mickael-menu/zk/util"
"github.com/mickael-menu/zk/util/fixtures"
"github.com/mickael-menu/zk/util/test/assert"
)
func TestWalk(t *testing.T) {
var path = fixtures.Path("walk")
actual := make([]string, 0)
for m := range Walk(path, "md", &util.NullLogger) {
assert.NotNil(t, m.Modified)
actual = append(actual, m.Path)
}
assert.Equal(t, actual, []string{
"a.md",
"b.md",
"dir1/a.md",
"dir1/b.md",
"dir1/dir1/a.md",
"dir2/a.md",
})
}