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 26 27 28 29 30 31 32 33 34
|
package sprig
import (
"testing"
)
var (
// fastCertKeyAlgos is the list of private key algorithms that are supported for certificate use, and
// are fast to generate.
fastCertKeyAlgos = []string{
"ecdsa",
"ed25519",
}
)
func TestSha256Sum(t *testing.T) {
tpl := `{{"abc" | sha256sum}}`
if err := runt(tpl, "ba7816bf8f01cfea414140de5dae2223b00361a396177a9cb410ff61f20015ad"); err != nil {
t.Error(err)
}
}
func TestSha1Sum(t *testing.T) {
tpl := `{{"abc" | sha1sum}}`
if err := runt(tpl, "a9993e364706816aba3e25717850c26c9cd0d89d"); err != nil {
t.Error(err)
}
}
func TestAdler32Sum(t *testing.T) {
tpl := `{{"abc" | adler32sum}}`
if err := runt(tpl, "38600999"); err != nil {
t.Error(err)
}
}
|