Skip to content

Commit

Permalink
T
Browse files Browse the repository at this point in the history
  • Loading branch information
sevein committed Jul 13, 2024
1 parent 7a5e7f4 commit 58b0b68
Showing 1 changed file with 13 additions and 5 deletions.
18 changes: 13 additions & 5 deletions bagit_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,19 +11,27 @@ import (
"gotest.tools/v3/fs"
)

func setUp(t *testing.T) *bagit.BagIt {
t.Helper()
func setUp(tb testing.TB) *bagit.BagIt {
tb.Helper()

b, err := bagit.NewBagIt()
assert.NilError(t, err)
assert.NilError(tb, err)

t.Cleanup(func() {
assert.NilError(t, b.Cleanup())
tb.Cleanup(func() {
assert.NilError(tb, b.Cleanup())
})

return b
}

func BenchmarkValidate(b *testing.B) {
bagit := setUp(b)
b.ResetTimer()
for i := 0; i < b.N; i++ {
_ = bagit.Validate("internal/testdata/valid-bag")
}
}

func TestValidateBag(t *testing.T) {
t.Parallel()

Expand Down

0 comments on commit 58b0b68

Please sign in to comment.