(t *testing.T)
| 523 | } |
| 524 | |
| 525 | func TestDepsNormalizeImport(t *testing.T) { |
| 526 | tests := []struct { |
| 527 | name string |
| 528 | imp string |
| 529 | want string |
| 530 | }{ |
| 531 | {name: "trims quotes", imp: "\"pkg/util\"", want: "pkg/util"}, |
| 532 | {name: "python dotted path", imp: "app.core.config", want: filepath.Join("app", "core", "config")}, |
| 533 | {name: "crate path", imp: "crate::net::http", want: filepath.Join("net", "http")}, |
| 534 | {name: "super path", imp: "super::service::api", want: filepath.Join("super", "service", "api")}, |
| 535 | {name: "already slash path", imp: "src/util", want: "src/util"}, |
| 536 | } |
| 537 | |
| 538 | for _, tt := range tests { |
| 539 | t.Run(tt.name, func(t *testing.T) { |
| 540 | got := normalizeImport(tt.imp) |
| 541 | if got != tt.want { |
| 542 | t.Fatalf("normalizeImport(%q): want %q, got %q", tt.imp, tt.want, got) |
| 543 | } |
| 544 | }) |
| 545 | } |
| 546 | } |
| 547 | |
| 548 | func TestDepsResolveRelative(t *testing.T) { |
| 549 | handlerPath := filepath.FromSlash("pkg/api/handler.go") |
nothing calls this directly
no test coverage detected