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

import (
	"testing"

	"codeberg.org/lindenii/furgit/objectid"
)

// 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)
		})
	}
}