pkger/parser/parser_test.go

29 lines
432 B
Go
Raw Normal View History

2019-08-01 19:03:12 +03:00
package parser
import (
2019-08-02 00:35:42 +03:00
"sort"
2019-08-01 19:03:12 +03:00
"testing"
2019-10-18 19:01:48 +03:00
"github.com/markbates/pkger/pkging/pkgtest"
2019-08-01 19:03:12 +03:00
"github.com/stretchr/testify/require"
)
2019-10-15 23:40:45 +03:00
func Test_Parser_App(t *testing.T) {
r := require.New(t)
2019-10-18 22:16:53 +03:00
app, err := pkgtest.App()
2019-10-15 23:40:45 +03:00
r.NoError(err)
2019-10-18 22:16:53 +03:00
res, err := Parse(app.Info)
2019-10-15 23:40:45 +03:00
r.NoError(err)
act := make([]string, len(res))
for i := 0; i < len(res); i++ {
act[i] = res[i].String()
}
sort.Strings(act)
2019-10-18 22:16:53 +03:00
r.Equal(app.Paths.Parser, act)
2019-10-15 23:40:45 +03:00
}