github.com/solo-io/cue@v0.4.7/cue/testdata/resolve/044_field_templates.txtar (about) 1 # DO NOT EDIT; generated by go run testdata/gen.go 2 # 3 #name: field templates 4 #evalPartial 5 -- in.cue -- 6 a: { 7 {[name=_]: int} 8 k: 1 9 } 10 b: { 11 {[X=_]: {x: 0, y: *1 | int}} 12 v: {} 13 w: {x: 0} 14 } 15 b: {[y=_]: {}} 16 c: { 17 {[Name=_]: {name: Name, y: 1}} 18 foo: {} 19 bar: _ 20 } 21 -- out/def -- 22 a: { 23 {[name=string]: int} 24 k: 1 25 } 26 b: { 27 {[X=string]: { 28 x: 0, y: *1 | int 29 }} 30 v: { 31 x: 0 32 y: *1 | int 33 } 34 w: { 35 x: 0 36 y: *1 | int 37 } 38 } 39 c: { 40 {[Name=string]: { 41 y: 1, name: Name 42 }} 43 foo: { 44 y: 1 45 name: "foo" 46 } 47 bar: { 48 y: 1 49 name: "bar" 50 } 51 } 52 -- out/export -- 53 a: { 54 k: 1 55 } 56 b: { 57 v: { 58 x: 0 59 y: 1 60 } 61 w: { 62 x: 0 63 y: 1 64 } 65 } 66 c: { 67 foo: { 68 y: 1 69 name: "foo" 70 } 71 bar: { 72 y: 1 73 name: "bar" 74 } 75 } 76 -- out/yaml -- 77 a: 78 k: 1 79 b: 80 v: 81 x: 0 82 y: 1 83 w: 84 x: 0 85 y: 1 86 c: 87 foo: 88 y: 1 89 name: foo 90 bar: 91 y: 1 92 name: bar 93 -- out/json -- 94 {"a":{"k":1},"b":{"v":{"x":0,"y":1},"w":{"x":0,"y":1}},"c":{"foo":{"y":1,"name":"foo"},"bar":{"y":1,"name":"bar"}}} 95 -- out/legacy-debug -- 96 <0>{a: <1>{[]: <2>(name: string)->int, k: 1}, b: <3>{[]: <4>(X: string)->(<5>{x: 0, y: (*1 | int)} & <6>{}), v: <7>{x: 0, y: (*1 | int)}, w: <8>{x: 0, y: (*1 | int)}}, c: <9>{[]: <10>(Name: string)-><11>{y: 1, name: <10>.Name}, foo: <12>{y: 1, name: "foo"}, bar: <13>{y: 1, name: "bar"}}} 97 -- out/compile -- 98 --- in.cue 99 { 100 a: { 101 { 102 [_]: int 103 } 104 k: 1 105 } 106 b: { 107 { 108 [_]: { 109 x: 0 110 y: (*1|int) 111 } 112 } 113 v: {} 114 w: { 115 x: 0 116 } 117 } 118 b: { 119 [_]: {} 120 } 121 c: { 122 { 123 [_]: { 124 name: 〈1;-〉 125 y: 1 126 } 127 } 128 foo: {} 129 bar: _ 130 } 131 } 132 -- out/eval -- 133 (struct){ 134 a: (struct){ 135 k: (int){ 1 } 136 } 137 b: (struct){ 138 v: (struct){ 139 x: (int){ 0 } 140 y: (int){ |(*(int){ 1 }, (int){ int }) } 141 } 142 w: (struct){ 143 x: (int){ 0 } 144 y: (int){ |(*(int){ 1 }, (int){ int }) } 145 } 146 } 147 c: (struct){ 148 foo: (struct){ 149 name: (string){ "foo" } 150 y: (int){ 1 } 151 } 152 bar: (struct){ 153 name: (string){ "bar" } 154 y: (int){ 1 } 155 } 156 } 157 }