(b *testing.B)
| 527 | } |
| 528 | |
| 529 | func BenchmarkGetObjectFromPackfile(b *testing.B) { |
| 530 | defer fixtures.Clean() |
| 531 | |
| 532 | for _, f := range fixtures.Basic() { |
| 533 | b.Run(f.URL, func(b *testing.B) { |
| 534 | fs := f.DotGit() |
| 535 | o := NewObjectStorage(dotgit.New(fs), cache.NewObjectLRUDefault()) |
| 536 | for i := 0; i < b.N; i++ { |
| 537 | expected := plumbing.NewHash("6ecf0ef2c2dffb796033e5a02219af86ec6584e5") |
| 538 | obj, err := o.EncodedObject(plumbing.AnyObject, expected) |
| 539 | if err != nil { |
| 540 | b.Fatal(err) |
| 541 | } |
| 542 | |
| 543 | if obj.Hash() != expected { |
| 544 | b.Errorf("expecting %s, got %s", expected, obj.Hash()) |
| 545 | } |
| 546 | } |
| 547 | }) |
| 548 | } |
| 549 | } |
nothing calls this directly
no test coverage detected