--- detectLanguages ---
(t *testing.T)
| 209 | // --- detectLanguages --- |
| 210 | |
| 211 | func TestDetectLanguages(t *testing.T) { |
| 212 | root := t.TempDir() |
| 213 | writeTestFile(t, filepath.Join(root, "main.go"), "package main\n") |
| 214 | writeTestFile(t, filepath.Join(root, "util.go"), "package main\n") |
| 215 | writeTestFile(t, filepath.Join(root, "script.py"), "print('hi')\n") |
| 216 | writeTestFile(t, filepath.Join(root, "vendor", "dep.go"), "package dep\n") |
| 217 | writeTestFile(t, filepath.Join(root, ".hidden", "x.go"), "package x\n") |
| 218 | |
| 219 | langs := detectLanguages(root) |
| 220 | if len(langs) != 2 { |
| 221 | t.Fatalf("expected 2 languages, got %v", langs) |
| 222 | } |
| 223 | // Go has 2 files vs Python's 1 (vendor/ and .hidden/ are skipped), |
| 224 | // so Go must sort first. |
| 225 | if langs[0] != "Go" || langs[1] != "Python" { |
| 226 | t.Errorf("expected [Go Python], got %v", langs) |
| 227 | } |
| 228 | } |
| 229 | |
| 230 | // --- extractRelevantCode --- |
| 231 |
nothing calls this directly
no test coverage detected