(t *testing.T)
| 7 | ) |
| 8 | |
| 9 | func TestProjectPath(t *testing.T) { |
| 10 | type args struct { |
| 11 | url string |
| 12 | } |
| 13 | type want struct { |
| 14 | path string |
| 15 | err error |
| 16 | } |
| 17 | tests := []struct { |
| 18 | name string |
| 19 | args args |
| 20 | want want |
| 21 | }{ |
| 22 | { |
| 23 | name: "default url", |
| 24 | args: args{ |
| 25 | url: "https://gitlab.com/git-bug/git-bug", |
| 26 | }, |
| 27 | want: want{ |
| 28 | path: "git-bug/git-bug", |
| 29 | err: nil, |
| 30 | }, |
| 31 | }, |
| 32 | { |
| 33 | name: "multiple sub groups", |
| 34 | args: args{ |
| 35 | url: "https://gitlab.com/git-bug/group/subgroup/git-bug", |
| 36 | }, |
| 37 | want: want{ |
| 38 | path: "git-bug/group/subgroup/git-bug", |
| 39 | err: nil, |
| 40 | }, |
| 41 | }, |
| 42 | { |
| 43 | name: "default url with git extension", |
| 44 | args: args{ |
| 45 | url: "https://gitlab.com/git-bug/git-bug.git", |
| 46 | }, |
| 47 | want: want{ |
| 48 | path: "git-bug/git-bug", |
| 49 | err: nil, |
| 50 | }, |
| 51 | }, |
| 52 | { |
| 53 | name: "url with git protocol", |
| 54 | args: args{ |
| 55 | url: "git://gitlab.com/git-bug/git-bug.git", |
| 56 | }, |
| 57 | want: want{ |
| 58 | path: "git-bug/git-bug", |
| 59 | err: nil, |
| 60 | }, |
| 61 | }, |
| 62 | { |
| 63 | name: "ssh url", |
| 64 | args: args{ |
| 65 | url: "git@gitlab.com/git-bug/git-bug.git", |
| 66 | }, |
nothing calls this directly
no test coverage detected