(t *testing.T)
| 150 | } |
| 151 | |
| 152 | func Test_RepoClone(t *testing.T) { |
| 153 | tests := []struct { |
| 154 | name string |
| 155 | args string |
| 156 | want string |
| 157 | }{ |
| 158 | { |
| 159 | name: "shorthand", |
| 160 | args: "OWNER/REPO", |
| 161 | want: "git clone https://github.com/OWNER/REPO.git", |
| 162 | }, |
| 163 | { |
| 164 | name: "shorthand with directory", |
| 165 | args: "OWNER/REPO target_directory", |
| 166 | want: "git clone https://github.com/OWNER/REPO.git target_directory", |
| 167 | }, |
| 168 | { |
| 169 | name: "clone arguments", |
| 170 | args: "OWNER/REPO -- -o upstream --depth 1", |
| 171 | want: "git clone -o upstream --depth 1 https://github.com/OWNER/REPO.git", |
| 172 | }, |
| 173 | { |
| 174 | name: "clone arguments with directory", |
| 175 | args: "OWNER/REPO target_directory -- -o upstream --depth 1", |
| 176 | want: "git clone -o upstream --depth 1 https://github.com/OWNER/REPO.git target_directory", |
| 177 | }, |
| 178 | { |
| 179 | name: "HTTPS URL", |
| 180 | args: "https://github.com/OWNER/REPO", |
| 181 | want: "git clone https://github.com/OWNER/REPO.git", |
| 182 | }, |
| 183 | { |
| 184 | name: "HTTPS URL with extra path parts", |
| 185 | args: "https://github.com/OWNER/REPO/extra/part?key=value#fragment", |
| 186 | want: "git clone https://github.com/OWNER/REPO.git", |
| 187 | }, |
| 188 | { |
| 189 | name: "SSH URL", |
| 190 | args: "git@github.com:OWNER/REPO.git", |
| 191 | want: "git clone git@github.com:OWNER/REPO.git", |
| 192 | }, |
| 193 | { |
| 194 | name: "Non-canonical capitalization", |
| 195 | args: "Owner/Repo", |
| 196 | want: "git clone https://github.com/OWNER/REPO.git", |
| 197 | }, |
| 198 | { |
| 199 | name: "clone wiki", |
| 200 | args: "Owner/Repo.wiki", |
| 201 | want: "git clone https://github.com/OWNER/REPO.wiki.git", |
| 202 | }, |
| 203 | { |
| 204 | name: "wiki URL", |
| 205 | args: "https://github.com/owner/repo.wiki", |
| 206 | want: "git clone https://github.com/OWNER/REPO.wiki.git", |
| 207 | }, |
| 208 | { |
| 209 | name: "wiki URL with extra path parts", |
nothing calls this directly
no test coverage detected