MCPcopy Index your code
hub / github.com/dgraph-io/dgraph / TestGetUIDInDebugMode

Function TestGetUIDInDebugMode

query/query0_test.go:441–465  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

439}
440
441func TestGetUIDInDebugMode(t *testing.T) {
442 query := `
443 {
444 me(func: uid(0x01)) {
445 name
446 uid
447 gender
448 alive
449 friend {
450 uid
451 name
452 }
453 }
454 }
455 `
456
457 ctx := context.Background()
458 ctx = context.WithValue(ctx, DebugKey, "true")
459 js, err := processQuery(ctx, t, query)
460 require.NoError(t, err)
461 require.JSONEq(t,
462 `{"data": {"me":[{"uid":"0x1","alive":true,"friend":[{"uid":"0x17","name":"Rick Grimes"},{"uid":"0x18","name":"Glenn Rhee"},{"uid":"0x19","name":"Daryl Dixon"},{"uid":"0x1f","name":"Andrea"},{"uid":"0x65"}],"gender":"female","name":"Michonne"}]}}`,
463 js)
464
465}
466
467func TestReturnUids(t *testing.T) {
468 query := `

Callers

nothing calls this directly

Calls 1

processQueryFunction · 0.70

Tested by

no test coverage detected