This commit is contained in:
Tomas Dvorak
2026-02-24 10:33:59 +01:00
parent 409acd2e08
commit 898a3c303f
1374 changed files with 290409 additions and 29187 deletions
@@ -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)
}
}
}