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

Function TestDepsDetectLanguage

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

Source from the content-addressed store, hash-verified

754}
755
756func TestDepsDetectLanguage(t *testing.T) {
757 tests := []struct {
758 name string
759 path string
760 want string
761 }{
762 {name: "go file", path: "main.go", want: "go"},
763 {name: "typescript upper extension", path: "comp.TSX", want: "typescript"},
764 {name: "scala", path: "build.sc", want: "scala"},
765 {name: "unknown extension", path: "README.md", want: ""},
766 }
767
768 for _, tt := range tests {
769 t.Run(tt.name, func(t *testing.T) {
770 got := DetectLanguage(tt.path)
771 if got != tt.want {
772 t.Fatalf("DetectLanguage(%q): want %q, got %q", tt.path, tt.want, got)
773 }
774 })
775 }
776}
777
778func TestParseCsproj(t *testing.T) {
779 csproj := `<Project Sdk="Microsoft.NET.Sdk">

Callers

nothing calls this directly

Calls 1

DetectLanguageFunction · 0.85

Tested by

no test coverage detected