MCPcopy Create free account
hub / github.com/golang/appengine / TestStructCodec

Function TestStructCodec

datastore/prop_test.go:62–308  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

60}
61
62func TestStructCodec(t *testing.T) {
63 type oStruct struct {
64 O int
65 }
66 type pStruct struct {
67 P int
68 Q int
69 }
70 type rStruct struct {
71 R int
72 S pStruct
73 T oStruct
74 oStruct
75 }
76 type uStruct struct {
77 U int
78 v int
79 }
80 type vStruct struct {
81 V string `datastore:",noindex"`
82 }
83 oStructCodec := &structCodec{
84 fields: map[string]fieldCodec{
85 "O": {path: []int{0}},
86 },
87 complete: true,
88 }
89 pStructCodec := &structCodec{
90 fields: map[string]fieldCodec{
91 "P": {path: []int{0}},
92 "Q": {path: []int{1}},
93 },
94 complete: true,
95 }
96 rStructCodec := &structCodec{
97 fields: map[string]fieldCodec{
98 "R": {path: []int{0}},
99 "S": {path: []int{1}, structCodec: pStructCodec},
100 "T": {path: []int{2}, structCodec: oStructCodec},
101 "O": {path: []int{3, 0}},
102 },
103 complete: true,
104 }
105 uStructCodec := &structCodec{
106 fields: map[string]fieldCodec{
107 "U": {path: []int{0}},
108 },
109 complete: true,
110 }
111 vStructCodec := &structCodec{
112 fields: map[string]fieldCodec{
113 "V": {path: []int{0}, noIndex: true},
114 },
115 complete: true,
116 }
117
118 testCases := []struct {
119 desc string

Callers

nothing calls this directly

Calls 2

getStructCodecFunction · 0.70
isEqualStructCodecFunction · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…