1 // Copyright 2018 The Go Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style
3 // license that can be found in the LICENSE file.
12 "golang.org/x/tools/godoc/vfs"
13 "golang.org/x/tools/godoc/vfs/gatefs"
16 func TestRootType(t *testing.T) {
17 goPath := os.Getenv("GOPATH")
18 var expectedType vfs.RootType
22 expectedType = vfs.RootTypeGoPath
28 {runtime.GOROOT(), vfs.RootTypeGoRoot},
29 {goPath, expectedType},
33 for _, item := range tests {
34 fs := gatefs.New(vfs.OS(item.path), make(chan bool, 1))
35 if fs.RootType("path") != item.fsType {
36 t.Errorf("unexpected fsType. Expected- %v, Got- %v", item.fsType, fs.RootType("path"))