(t *testing.T)
| 26 | } |
| 27 | |
| 28 | func 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 | |
| 44 | func mustWriteFile(t *testing.T, path, content string) { |
| 45 | t.Helper() |
nothing calls this directly
no test coverage detected