(t *testing.T)
| 60 | } |
| 61 | |
| 62 | func 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 |
nothing calls this directly
no test coverage detected
searching dependent graphs…