(t *testing.T)
| 31 | } |
| 32 | |
| 33 | func TestNormalizeImport(t *testing.T) { |
| 34 | tests := []struct { |
| 35 | name string |
| 36 | input string |
| 37 | expected string |
| 38 | }{ |
| 39 | {name: "removes quotes", input: "\"pkg/util\"", expected: "pkg/util"}, |
| 40 | {name: "python dots to slashes", input: "app.core.config", expected: filepath.Join("app", "core", "config")}, |
| 41 | {name: "relative dotted import unchanged", input: "../app.core", expected: "../app.core"}, |
| 42 | {name: "crate import converted", input: "crate::feature::parser", expected: filepath.Join("feature", "parser")}, |
| 43 | {name: "super import converted", input: "super::module::item", expected: filepath.Join("super", "module", "item")}, |
| 44 | } |
| 45 | |
| 46 | for _, tt := range tests { |
| 47 | t.Run(tt.name, func(t *testing.T) { |
| 48 | got := normalizeImport(tt.input) |
| 49 | if got != tt.expected { |
| 50 | t.Errorf("normalizeImport(%q) = %q, want %q", tt.input, got, tt.expected) |
| 51 | } |
| 52 | }) |
| 53 | } |
| 54 | } |
| 55 | |
| 56 | func TestBuildFileIndex(t *testing.T) { |
| 57 | files := []FileInfo{ |
nothing calls this directly
no test coverage detected