(t *testing.T)
| 754 | } |
| 755 | |
| 756 | func 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 | |
| 778 | func TestParseCsproj(t *testing.T) { |
| 779 | csproj := `<Project Sdk="Microsoft.NET.Sdk"> |
nothing calls this directly
no test coverage detected