github.com/golang/dep@v0.5.4/gps/paths/paths_test.go (about) 1 // Copyright 2017 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. 4 5 package paths 6 7 import ( 8 "testing" 9 10 _ "github.com/golang/dep/internal/test" // DO NOT REMOVE, allows go test ./... -update to work 11 ) 12 13 func TestIsStandardImportPath(t *testing.T) { 14 fix := []struct { 15 ip string 16 is bool 17 }{ 18 {"appengine", true}, 19 {"net/http", true}, 20 {"github.com/anything", false}, 21 {"github.com", false}, 22 {"foo", true}, 23 {".", false}, 24 } 25 26 for _, f := range fix { 27 r := IsStandardImportPath(f.ip) 28 if r != f.is { 29 if r { 30 t.Errorf("%s was marked stdlib but should not have been", f.ip) 31 } else { 32 t.Errorf("%s was not marked stdlib but should have been", f.ip) 33 34 } 35 } 36 } 37 }