mirror of https://github.com/markbates/pkger.git
33 lines
504 B
Go
33 lines
504 B
Go
package here
|
|
|
|
import (
|
|
"testing"
|
|
|
|
"github.com/stretchr/testify/require"
|
|
)
|
|
|
|
func Test_nonGoDirRx(t *testing.T) {
|
|
r := require.New(t)
|
|
r.False(nonGoDirRx.MatchString(""))
|
|
r.False(nonGoDirRx.MatchString("hello"))
|
|
|
|
table := []string{
|
|
"go: cannot find main module; see 'go help modules'",
|
|
"go help modules",
|
|
"go: ",
|
|
"build .:",
|
|
"no Go files",
|
|
}
|
|
|
|
for _, tt := range table {
|
|
t.Run(tt, func(st *testing.T) {
|
|
r := require.New(st)
|
|
|
|
b := nonGoDirRx.MatchString(tt)
|
|
r.True(b)
|
|
|
|
})
|
|
}
|
|
|
|
}
|