Files
Devour/internal/quality/plugins/go/analyzers/deadcode_test.go
T
Tomas Dvorak 898a3c303f update
2026-02-24 10:33:59 +01:00

23 lines
492 B
Go

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)
}
}
}