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

Function TestDetectLanguagesFromFiles_SubdirectorySources

cmd/context_test.go:28–42  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

26}
27
28func TestDetectLanguagesFromFiles_SubdirectorySources(t *testing.T) {
29 root := t.TempDir()
30
31 mustWriteFile(t, filepath.Join(root, "src", "main.ts"), "export const n = 1")
32 mustWriteFile(t, filepath.Join(root, "internal", "core", "worker.go"), "package core")
33
34 langs := detectLanguagesFromFiles(root)
35
36 if !langs["typescript"] {
37 t.Fatalf("expected typescript from subdirectory source, got %#v", langs)
38 }
39 if !langs["go"] {
40 t.Fatalf("expected go from subdirectory source, got %#v", langs)
41 }
42}
43
44func mustWriteFile(t *testing.T, path, content string) {
45 t.Helper()

Callers

nothing calls this directly

Calls 2

mustWriteFileFunction · 0.85
detectLanguagesFromFilesFunction · 0.85

Tested by

no test coverage detected