git.sr.ht/~sircmpwn/gqlgen@v0.0.0-20200522192042-c84d29a1c940/internal/code/util_test.go (about) 1 package code 2 3 import ( 4 "testing" 5 6 "github.com/stretchr/testify/require" 7 ) 8 9 func TestNormalizeVendor(t *testing.T) { 10 require.Equal(t, "bar/baz", NormalizeVendor("foo/vendor/bar/baz")) 11 require.Equal(t, "[]bar/baz", NormalizeVendor("[]foo/vendor/bar/baz")) 12 require.Equal(t, "*bar/baz", NormalizeVendor("*foo/vendor/bar/baz")) 13 require.Equal(t, "*[]*bar/baz", NormalizeVendor("*[]*foo/vendor/bar/baz")) 14 require.Equal(t, "[]*bar/baz", NormalizeVendor("[]*foo/vendor/bar/baz")) 15 }