Add test for sha256sum function
This commit is contained in:
parent
bc4c23b04c
commit
b9a5bd8a9c
|
|
@ -219,3 +219,17 @@ func Example_getenv() {
|
|||
// BAZ: foobar
|
||||
// FOOBARBAZ
|
||||
}
|
||||
|
||||
func Example_sha256sum() {
|
||||
tmpl, err := template.New("sha256sum").Funcs(templatelib.FuncMap).Parse(`
|
||||
{{- "Hello World!" | sha256sum -}}
|
||||
`)
|
||||
|
||||
err = tmpl.Execute(os.Stdout, nil)
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
|
||||
// Output:
|
||||
// 7f83b1657ff1fc53b92dc18148a1d65dfc2d4b1fa3d677284addd200126d9069
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue