(t *testing.T)
| 301 | } |
| 302 | |
| 303 | func TestRefgroups(t *testing.T) { |
| 304 | t.Parallel() |
| 305 | |
| 306 | references := []string{ |
| 307 | "refs/changes/20/884120/1", |
| 308 | "refs/changes/45/12345/42", |
| 309 | "refs/fo", |
| 310 | "refs/foo", |
| 311 | "refs/heads/foo", |
| 312 | "refs/heads/main", |
| 313 | "refs/notes/discussion", |
| 314 | "refs/notes/tests/build", |
| 315 | "refs/notes/tests/default", |
| 316 | "refs/pull/1/head", |
| 317 | "refs/pull/1/merge", |
| 318 | "refs/pull/123/head", |
| 319 | "refs/pull/1234/head", |
| 320 | "refs/remotes/origin/master", |
| 321 | "refs/remotes/upstream/foo", |
| 322 | "refs/remotes/upstream/master", |
| 323 | "refs/stash", |
| 324 | "refs/tags/foolish", |
| 325 | "refs/tags/other", |
| 326 | "refs/tags/release-1", |
| 327 | "refs/tags/release-2", |
| 328 | } |
| 329 | |
| 330 | // Create a test repo with one orphan commit per refname: |
| 331 | repo := testutils.NewTestRepo(t, true, "refgroups") |
| 332 | t.Cleanup(func() { repo.Remove(t) }) |
| 333 | |
| 334 | for _, refname := range references { |
| 335 | repo.CreateReferencedOrphan(t, refname) |
| 336 | } |
| 337 | |
| 338 | executable := sizerExe(t) |
| 339 | |
| 340 | for _, p := range []struct { |
| 341 | name string |
| 342 | args []string |
| 343 | config []git.ConfigEntry |
| 344 | stdout string |
| 345 | stderr string |
| 346 | }{ |
| 347 | { |
| 348 | name: "no arguments", |
| 349 | stdout: ` |
| 350 | | * References | | | |
| 351 | | * Count | 21 | | |
| 352 | | * Branches | 2 | | |
| 353 | | * Tags | 4 | | |
| 354 | | * Remote-tracking refs | 3 | | |
| 355 | | * Pull request refs | 4 | | |
| 356 | | * Changeset refs | 2 | | |
| 357 | | * Git notes | 3 | | |
| 358 | | * Git stash | 1 | | |
| 359 | | * Other | 2 | | |
| 360 | | | | | |
nothing calls this directly
no test coverage detected