(t *testing.T)
| 227 | } |
| 228 | |
| 229 | func TestGitService_ListMatchingRefs_noRefs(t *testing.T) { |
| 230 | t.Parallel() |
| 231 | client, mux, _ := setup(t) |
| 232 | |
| 233 | mux.HandleFunc("/repos/o/r/git/matching-refs/heads/b", func(w http.ResponseWriter, r *http.Request) { |
| 234 | testMethod(t, r, "GET") |
| 235 | fmt.Fprint(w, "[]") |
| 236 | }) |
| 237 | |
| 238 | ctx := t.Context() |
| 239 | refs, _, err := client.Git.ListMatchingRefs(ctx, "o", "r", "heads/b") |
| 240 | if err != nil { |
| 241 | t.Errorf("Git.ListMatchingRefs returned error: %v", err) |
| 242 | } |
| 243 | |
| 244 | if len(refs) != 0 { |
| 245 | t.Errorf("Git.ListMatchingRefs returned %+v, want an empty slice", refs) |
| 246 | } |
| 247 | |
| 248 | const methodName = "ListMatchingRefs" |
| 249 | testBadOptions(t, methodName, func() (err error) { |
| 250 | _, _, err = client.Git.ListMatchingRefs(ctx, "\n", "\n", "") |
| 251 | return err |
| 252 | }) |
| 253 | |
| 254 | testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { |
| 255 | got, resp, err := client.Git.ListMatchingRefs(ctx, "o", "r", "") |
| 256 | if got != nil { |
| 257 | t.Errorf("testNewRequestAndDoFailure %v = %#v, want nil", methodName, got) |
| 258 | } |
| 259 | return resp, err |
| 260 | }) |
| 261 | } |
| 262 | |
| 263 | func TestGitService_ListMatchingRefs_allRefs(t *testing.T) { |
| 264 | t.Parallel() |
nothing calls this directly
no test coverage detected
searching dependent graphs…