this repo has no description
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

internal/core/adt: add tests for 3931

Issue #3931
Issue #3919

Signed-off-by: Marcel van Lohuizen <mpvl@gmail.com>
Change-Id: I49983eeddc6cad4c24502e4b6a076617595a6a53
Reviewed-on: https://review.gerrithub.io/c/cue-lang/cue/+/1215498
TryBot-Result: CUEcueckoo <cueckoo@cuelang.org>
Unity-Result: CUE porcuepine <cue.porcuepine@gmail.com>
Reviewed-by: Daniel Martí <mvdan@mvdan.cc>

+170 -11
+170 -11
cue/testdata/eval/issue3919.txtar
··· 38 38 } 39 39 } 40 40 } 41 + -- let.cue -- 42 + issue3931: full: { 43 + bar: [string]: spec?: Spec 44 + if true { 45 + foo: label: "foo" 46 + bar: bar1: spec: selector: foo 47 + } 48 + let Spec = { 49 + selector?: Selector 50 + } 51 + let Selector = { 52 + label?: string 53 + expr?: [...string] 54 + } 55 + } 41 56 -- out/eval/stats -- 42 - Leaks: 2 43 - Freed: 32 44 - Reused: 26 45 - Allocs: 8 46 - Retain: 1 57 + Leaks: 7 58 + Freed: 44 59 + Reused: 38 60 + Allocs: 13 61 + Retain: 3 47 62 48 - Unifications: 30 49 - Conjuncts: 51 50 - Disjuncts: 35 63 + Unifications: 47 64 + Conjuncts: 73 65 + Disjuncts: 54 51 66 -- out/evalalpha -- 52 - (struct){ 67 + Errors: 68 + issue3931.full.bar.bar1.spec.selector: adding field expr not allowed as field set was already referenced: 69 + ./let.cue:8:14 70 + 71 + Result: 72 + (_|_){ 73 + // [eval] 53 74 full: (struct){ 54 75 out: (struct){ 55 76 env: (struct){ ··· 62 83 a: (int){ 30080 } 63 84 port: (int){ |(*(int){ 30080 }, (int){ int }) } 64 85 } 86 + issue3931: (_|_){ 87 + // [eval] 88 + full: (_|_){ 89 + // [eval] 90 + bar: (_|_){ 91 + // [eval] 92 + bar1: (_|_){ 93 + // [eval] 94 + spec: (_|_){ 95 + // [eval] 96 + selector: (_|_){ 97 + // [eval] issue3931.full.bar.bar1.spec.selector: adding field expr not allowed as field set was already referenced: 98 + // ./let.cue:8:14 99 + } 100 + } 101 + } 102 + } 103 + foo: (struct){ 104 + label: (string){ "foo" } 105 + } 106 + let Spec#1 = (struct){ 107 + selector?: (struct){ 108 + label?: (string){ string } 109 + expr?: (list){ 110 + } 111 + } 112 + } 113 + let Selector#2 = (struct){ 114 + label?: (string){ string } 115 + expr?: (list){ 116 + } 117 + } 118 + } 119 + } 65 120 related: (struct){ 66 121 foo: (struct){ 67 122 fooData: (struct){ ··· 101 156 diff old new 102 157 --- old 103 158 +++ new 104 - @@ -15,10 +15,7 @@ 159 + @@ -1,4 +1,10 @@ 160 + -(struct){ 161 + +Errors: 162 + +issue3931.full.bar.bar1.spec.selector: adding field expr not allowed as field set was already referenced: 163 + + ./let.cue:8:14 164 + + 165 + +Result: 166 + +(_|_){ 167 + + // [eval] 168 + full: (struct){ 169 + out: (struct){ 170 + env: (struct){ 171 + @@ -11,15 +17,19 @@ 172 + a: (int){ 30080 } 173 + port: (int){ |(*(int){ 30080 }, (int){ int }) } 174 + } 175 + - issue3931: (struct){ 176 + - full: (struct){ 177 + - bar: (struct){ 178 + - bar1: (struct){ 179 + - spec: (struct){ 180 + - selector: (struct){ 181 + - label: (string){ "foo" } 182 + - expr?: (list){ 183 + - } 184 + + issue3931: (_|_){ 185 + + // [eval] 186 + + full: (_|_){ 187 + + // [eval] 188 + + bar: (_|_){ 189 + + // [eval] 190 + + bar1: (_|_){ 191 + + // [eval] 192 + + spec: (_|_){ 193 + + // [eval] 194 + + selector: (_|_){ 195 + + // [eval] issue3931.full.bar.bar1.spec.selector: adding field expr not allowed as field set was already referenced: 196 + + // ./let.cue:8:14 197 + } 198 + } 199 + } 200 + @@ -45,10 +55,7 @@ 105 201 foo: (struct){ 106 202 fooData: (struct){ 107 203 total: (struct){ ··· 113 209 } 114 210 _hidden: (struct){ 115 211 extra: (struct){ 116 - @@ -26,12 +23,7 @@ 212 + @@ -56,12 +63,7 @@ 117 213 } 118 214 } 119 215 shared: (struct){ ··· 141 237 a: (int){ 30080 } 142 238 port: (int){ |(*(int){ 30080 }, (int){ int }) } 143 239 } 240 + issue3931: (struct){ 241 + full: (struct){ 242 + bar: (struct){ 243 + bar1: (struct){ 244 + spec: (struct){ 245 + selector: (struct){ 246 + label: (string){ "foo" } 247 + expr?: (list){ 248 + } 249 + } 250 + } 251 + } 252 + } 253 + foo: (struct){ 254 + label: (string){ "foo" } 255 + } 256 + let Spec#1 = (struct){ 257 + selector?: (struct){ 258 + label?: (string){ string } 259 + expr?: (list){ 260 + } 261 + } 262 + } 263 + let Selector#2 = (struct){ 264 + label?: (string){ string } 265 + expr?: (list){ 266 + } 267 + } 268 + } 269 + } 144 270 related: (struct){ 145 271 foo: (struct){ 146 272 fooData: (struct){ ··· 204 330 a: 〈import;math〉.Abs(〈1;port〉) 205 331 } 206 332 port: (int|*30080) 333 + } 334 + } 335 + --- let.cue 336 + { 337 + issue3931: { 338 + full: { 339 + bar: { 340 + [string]: { 341 + spec?: 〈2;let Spec#1〉 342 + } 343 + } 344 + if true { 345 + foo: { 346 + label: "foo" 347 + } 348 + bar: { 349 + bar1: { 350 + spec: { 351 + selector: 〈3;foo〉 352 + } 353 + } 354 + } 355 + } 356 + let Spec#1 = { 357 + selector?: 〈1;let Selector#2〉 358 + } 359 + let Selector#2 = { 360 + label?: string 361 + expr?: [ 362 + ...string, 363 + ] 364 + } 365 + } 207 366 } 208 367 } 209 368 --- secondary.cue