mirror of
https://github.com/Dvorinka/Devour.git
synced 2026-06-04 12:33:04 +00:00
update
This commit is contained in:
@@ -0,0 +1,22 @@
|
||||
package analyzers
|
||||
|
||||
import "testing"
|
||||
|
||||
func TestInferImportName(t *testing.T) {
|
||||
tests := []struct {
|
||||
path string
|
||||
want string
|
||||
}{
|
||||
{path: "fmt", want: "fmt"},
|
||||
{path: "gopkg.in/yaml.v3", want: "yaml"},
|
||||
{path: "github.com/gocolly/colly/v2", want: "colly"},
|
||||
{path: "golang.org/x/tools/go/packages", want: "packages"},
|
||||
}
|
||||
|
||||
for _, tt := range tests {
|
||||
got := inferImportName(tt.path)
|
||||
if got != tt.want {
|
||||
t.Fatalf("inferImportName(%q) = %q, want %q", tt.path, got, tt.want)
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user