vole
Clone
Read only, no credentials:
https://rodent.software/git/vole.git
Write over SSH with a registered key:
git clone ssh://git@0.0.0.0:2222/vole.git
A free and open-source forge that lives in your Git repo.
|
8dc56e4e
Keenan Nemetz
9d ago
|
1 | package lang |
| 2 | ||
| 3 | import ( | |
| 4 | "testing" | |
| 5 | ||
|
d37d301f
Keenan Nemetz
17h ago
|
6 | "rodent.software/vole/core/git" |
|
8dc56e4e
Keenan Nemetz
9d ago
|
7 | ) |
| 8 | ||
| 9 | func TestTopCountsFilesNotBytes(t *testing.T) { | |
| 10 | tree := []git.Entry{ | |
| 11 | {Type: "blob", Name: "main.go"}, | |
| 12 | {Type: "blob", Name: "server/server.go"}, | |
| 13 | {Type: "blob", Name: "README.md"}, | |
| 14 | {Type: "blob", Name: "big.bin"}, | |
| 15 | {Type: "tree", Name: "vendor"}, | |
| 16 | } | |
| 17 | name, class := Top(tree) | |
| 18 | if name != "Go" || class != "lang-go" { | |
| 19 | t.Fatalf("top language = %q (%q), want Go (lang-go)", name, class) | |
| 20 | } | |
| 21 | } | |
| 22 | ||
| 23 | func TestTopIgnoresUnknownWhenAnythingIsKnown(t *testing.T) { | |
| 24 | tree := []git.Entry{ | |
| 25 | {Type: "blob", Name: "a.bin"}, | |
| 26 | {Type: "blob", Name: "b.bin"}, | |
| 27 | {Type: "blob", Name: "notes.md"}, | |
| 28 | } | |
| 29 | if name, _ := Top(tree); name != "Markdown" { | |
| 30 | t.Fatalf("top language = %q, want Markdown", name) | |
| 31 | } | |
| 32 | if name, class := Top([]git.Entry{{Type: "blob", Name: "a.bin"}}); name != "" || class != "" { | |
| 33 | t.Fatalf("unknown-only tree = %q (%q), want empty", name, class) | |
| 34 | } | |
| 35 | } |