moby/libnetwork/resolvconf/utils_test.go
Sebastiaan van Stijn 572498be56
move pkg/ioutils.HashData() to libnetwork/resolvconf
It's the only location it's used, so we might as well move it there.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2021-08-20 00:35:39 +02:00

18 lines
366 B
Go

package resolvconf
import (
"strings"
"testing"
)
func TestHashData(t *testing.T) {
reader := strings.NewReader("hash-me")
actual, err := hashData(reader)
if err != nil {
t.Fatal(err)
}
expected := "sha256:4d11186aed035cc624d553e10db358492c84a7cd6b9670d92123c144930450aa"
if actual != expected {
t.Fatalf("Expecting %s, got %s", expected, actual)
}
}