forked from uudashr/gopkgs
-
Notifications
You must be signed in to change notification settings - Fork 0
/
vendor_test.go
40 lines (37 loc) · 960 Bytes
/
vendor_test.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
package gopkgs
import (
"testing"
)
func TestVendor(t *testing.T) {
cases := []struct {
workDir string
vendorDir string
visible bool
}{
{
workDir: "/home/foo/go/src/github.com/rogpeppe/godef",
vendorDir: "/home/foo/go/src/github.com/rogpeppe/godef",
visible: true,
},
{
workDir: "/home/foo/go/src/github.com/rogpeppe/godef/go",
vendorDir: "/home/foo/go/src/github.com/rogpeppe/godef",
visible: true,
},
{
workDir: "/home/foo/go/src/github.com/rogpeppe/godef/go/ast",
vendorDir: "/home/foo/go/src/github.com/rogpeppe/godef",
visible: true,
},
{
workDir: "/home/foo/go/src/github.com/rogpeppe/godef",
vendorDir: "/home/foo/go/src/github.com/uudashr/gopkgs/vendor/github.com/pkg/errors",
visible: false,
},
}
for i, c := range cases {
if got, want := visibleVendor(c.workDir, c.vendorDir), c.visible; got != want {
t.Error("got:", got, "want:", want, "case:", i)
}
}
}