MCPcopy Create free account
hub / github.com/JordanCoin/codemap / TestResolvePathAliasNoMatch

Function TestResolvePathAliasNoMatch

scanner/deps_test.go:475–496  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

473}
474
475func TestResolvePathAliasNoMatch(t *testing.T) {
476 files := []FileInfo{
477 {Path: "src/modules/auth/index.ts"},
478 }
479 idx := buildFileIndex(files, "")
480
481 pathAliases := map[string][]string{
482 "@modules/*": {"src/modules/*"},
483 }
484
485 // Import that doesn't match any alias
486 result := resolvePathAlias("lodash", pathAliases, ".", idx)
487 if len(result) != 0 {
488 t.Errorf("Expected no results for non-alias import, got %v", result)
489 }
490
491 // Import that matches alias but file doesn't exist
492 result = resolvePathAlias("@modules/nonexistent", pathAliases, ".", idx)
493 if len(result) != 0 {
494 t.Errorf("Expected no results for non-existent file, got %v", result)
495 }
496}
497
498func TestDepsBuildFileIndex(t *testing.T) {
499 handlerPath := filepath.FromSlash("pkg/service/handler.go")

Callers

nothing calls this directly

Calls 2

buildFileIndexFunction · 0.85
resolvePathAliasFunction · 0.85

Tested by

no test coverage detected