MCPcopy
hub / github.com/dgraph-io/dgraph / TestGetHash

Function TestGetHash

edgraph/server_test.go:202–209  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

200}
201
202func TestGetHash(t *testing.T) {
203 h := sha256.New()
204 _, err := h.Write([]byte("0xa0x140x313233343536373839"))
205 require.NoError(t, err)
206
207 worker.Config.AclSecretKeyBytes = x.Sensitive("123456789")
208 require.Equal(t, hex.EncodeToString(h.Sum(nil)), getHash(10, 20))
209}
210
211func TestVerifyUniqueWithinMutationBoundsChecks(t *testing.T) {
212 t.Run("gmuIndex out of bounds", func(t *testing.T) {

Callers

nothing calls this directly

Calls 3

SensitiveTypeAlias · 0.92
getHashFunction · 0.70
WriteMethod · 0.65

Tested by

no test coverage detected