Debian Codegraph @

util/sprig/crypto_test.go

raw
1 package sprig
2
3 import (
4 "testing"
5 )
6
7 func TestSha512Sum(t *testing.T) {
8 tpl := `{{"abc" | sha512sum}}`
9 if err := runt(tpl, "ddaf35a193617abacc417349ae20413112e6fa4e89a97ea20a9eeee64b55d39a2192992a274fc1a836ba3c23a3feebbd454d4423643ce80e2a9ac94fa54ca49f"); err != nil {
10 t.Error(err)
11 }
12 }
13
14 func TestSha256Sum(t *testing.T) {
15 tpl := `{{"abc" | sha256sum}}`
16 if err := runt(tpl, "ba7816bf8f01cfea414140de5dae2223b00361a396177a9cb410ff61f20015ad"); err != nil {
17 t.Error(err)
18 }
19 }
20
21 func TestSha1Sum(t *testing.T) {
22 tpl := `{{"abc" | sha1sum}}`
23 if err := runt(tpl, "a9993e364706816aba3e25717850c26c9cd0d89d"); err != nil {
24 t.Error(err)
25 }
26 }
27
28 func TestAdler32Sum(t *testing.T) {
29 tpl := `{{"abc" | adler32sum}}`
30 if err := runt(tpl, "38600999"); err != nil {
31 t.Error(err)
32 }
33 }