Files
polaris/vendor/github.com/gobuffalo/packd/skip_walker_test.go
Bobby Brennan 54a4f92695 Pack static assets into packr box for portability
copy config.yaml to docker image

enable external usage of dashboard package

gofmt

fix comment

use packr for assets

add gobuffalo/packr dependency

add dependencies

fix pointer issues

add output-file option
2019-04-18 18:25:16 +00:00

43 lines
800 B
Go

package packd
import (
"sort"
"testing"
"github.com/stretchr/testify/require"
)
func Test_SkipWalker(t *testing.T) {
r := require.New(t)
box := NewMemoryBox()
files := []string{
"node_modules/foo.js",
".idea/something",
"main.go",
"actions/app.go",
"_example/foo.go",
"_example/bar.go",
"_EXAMPLE/bar.go",
"actions/app_test.go",
"/go/src/hello_world/node_modules/ejs/README.md",
"/go/src/hello_world/NODE_MODULES/ejs/README.md",
}
for _, f := range files {
box.AddString(f, f)
}
var found []string
err := SkipWalker(box, CommonSkipPrefixes, func(path string, file File) error {
found = append(found, path)
return nil
})
r.NoError(err)
r.Len(found, 3)
sort.Strings(found)
r.Equal([]string{"actions/app.go", "actions/app_test.go", "main.go"}, found)
}