aboutsummaryrefslogtreecommitdiff
path: root/internal/testgit/algorithms.go
blob: 78613dbecc347e9470b63c9a80b99f0b58d6bd97 (about) (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
package testgit

import (
	"testing"

	objectid "lindenii.org/go/furgit/object/id"
)

// ForEachAlgorithm runs a subtest for every supported algorithm.
func ForEachAlgorithm(t *testing.T, fn func(t *testing.T, algo objectid.Algorithm)) {
	t.Helper()

	for _, algo := range objectid.SupportedAlgorithms() {
		t.Run(algo.String(), func(t *testing.T) {
			fn(t, algo)
		})
	}
}