shithub: furgit

ref: 0a4686c132052d9b01ac5d438c6a46e7b4fe22e5
dir: /internal/testgit/algorithms.go/

View raw version
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)
		})
	}
}