blob: 6d7a756543b07bc517533da0c7cc5e024150ce61 (
about) (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
|
package testgit
import (
"testing"
"codeberg.org/lindenii/furgit/objectid"
)
// SupportedAlgorithms returns all object ID algorithms supported by furgit.
func SupportedAlgorithms() []objectid.Algorithm {
return []objectid.Algorithm{
objectid.AlgorithmSHA1,
objectid.AlgorithmSHA256,
}
}
// 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 SupportedAlgorithms() {
t.Run(algo.String(), func(t *testing.T) {
fn(t, algo)
})
}
}
|