mirror of
https://github.com/mickael-menu/zk
synced 2024-11-17 09:25:44 +00:00
50855154e2
* Move everything under the internal package. * Better separation between core and adapter packages, for easier unit testing. * Simplify data models. * Support multiple opened notebooks during runtime (useful for the LSP server). * Proper surface API which might be exposed later as a public Go package.
31 lines
572 B
Go
31 lines
572 B
Go
package paths
|
|
|
|
import (
|
|
"testing"
|
|
|
|
"github.com/mickael-menu/zk/internal/util"
|
|
"github.com/mickael-menu/zk/internal/util/fixtures"
|
|
"github.com/mickael-menu/zk/internal/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{
|
|
"Dir3/a.md",
|
|
"a.md",
|
|
"b.md",
|
|
"dir1/a.md",
|
|
"dir1/b.md",
|
|
"dir1/dir1/a.md",
|
|
"dir1 a space/a.md",
|
|
"dir2/a.md",
|
|
})
|
|
}
|