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

Function TestDetectLanguage

scanner/filegraph_test.go:11–31  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

9)
10
11func TestDetectLanguage(t *testing.T) {
12 tests := []struct {
13 name string
14 path string
15 expected string
16 }{
17 {name: "go extension", path: "main.go", expected: "go"},
18 {name: "uppercase extension", path: "handler.PY", expected: "python"},
19 {name: "unknown extension", path: "README.md", expected: ""},
20 {name: "no extension", path: "Makefile", expected: ""},
21 }
22
23 for _, tt := range tests {
24 t.Run(tt.name, func(t *testing.T) {
25 got := DetectLanguage(tt.path)
26 if got != tt.expected {
27 t.Errorf("DetectLanguage(%q) = %q, want %q", tt.path, got, tt.expected)
28 }
29 })
30 }
31}
32
33func TestNormalizeImport(t *testing.T) {
34 tests := []struct {

Callers

nothing calls this directly

Calls 1

DetectLanguageFunction · 0.85

Tested by

no test coverage detected