1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
|
// Copyright 2020 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package modzip
import "testing"
func TestIsVendoredPackage(t *testing.T) {
for _, tc := range []struct {
path string
want bool
}{
{path: "cue.mod/vendor/foo", want: true},
{path: "vendor/foo/foo.go", want: false},
} {
got := isVendoredPackage(tc.path)
if got != tc.want {
t.Errorf("isVendoredPackage(%q) = %t; want %t", tc.path, got, tc.want)
}
}
}
|