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"
15 func TestRootType(t *testing.T) {
16 goPath := os.Getenv("GOPATH")
17 var expectedType vfs.RootType
21 expectedType = vfs.RootTypeGoPath
27 {runtime.GOROOT(), vfs.RootTypeGoRoot},
28 {goPath, expectedType},
32 for _, item := range tests {
33 fs := vfs.OS(item.path)
34 if fs.RootType("path") != item.fsType {
35 t.Errorf("unexpected fsType. Expected- %v, Got- %v", item.fsType, fs.RootType("path"))