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 3780

This is added post fix as the test caused a panic.

Fixes #3780

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

+156 -6
+156 -6
cue/testdata/eval/counters.txtar
··· 34 34 } 35 35 } 36 36 } 37 + -- issue3780.cue -- 38 + import "strings" 39 + 40 + issue3780: panic1: { 41 + objs: #Objects & {} 42 + param!: bool 43 + if param { 44 + objs: obj1: { 45 + one: 1 46 + two: 2 47 + } 48 + } 49 + #Objects: [strings.HasPrefix("obj")]: { 50 + kind: "object" 51 + ... 52 + } 53 + } 54 + issue3780: panic2: { 55 + parent: { 56 + objs: #Objects & {} 57 + param?: bool 58 + if param != _|_ { 59 + objs: obj1: { 60 + one: 1 61 + two: 2 62 + } 63 + } 64 + #Objects: [strings.HasPrefix("obj")]: { 65 + kind: "object" 66 + ... 67 + } 68 + } 69 + } 37 70 -- out/compile -- 38 71 --- issue3750.cue 39 72 { ··· 84 117 } 85 118 } 86 119 } 120 + --- issue3780.cue 121 + { 122 + issue3780: { 123 + panic1: { 124 + objs: (〈0;#Objects〉 & {}) 125 + param!: bool 126 + if 〈0;param〉 { 127 + objs: { 128 + obj1: { 129 + one: 1 130 + two: 2 131 + } 132 + } 133 + } 134 + #Objects: { 135 + [〈import;strings〉.HasPrefix("obj")]: { 136 + kind: "object" 137 + ... 138 + } 139 + } 140 + } 141 + } 142 + issue3780: { 143 + panic2: { 144 + parent: { 145 + objs: (〈0;#Objects〉 & {}) 146 + param?: bool 147 + if (〈0;param〉 != _|_(explicit error (_|_ literal) in source)) { 148 + objs: { 149 + obj1: { 150 + one: 1 151 + two: 2 152 + } 153 + } 154 + } 155 + #Objects: { 156 + [〈import;strings〉.HasPrefix("obj")]: { 157 + kind: "object" 158 + ... 159 + } 160 + } 161 + } 162 + } 163 + } 164 + } 165 + -- out/evalalpha/stats -- 166 + Leaks: 205 167 + Freed: 0 168 + Reused: 0 169 + Allocs: 205 170 + Retain: 0 171 + 172 + Unifications: 161 173 + Conjuncts: 240 174 + Disjuncts: 32 175 + -- diff/-out/evalalpha/stats<==>+out/eval/stats -- 176 + diff old new 177 + --- old 178 + +++ new 179 + @@ -1,9 +1,9 @@ 180 + -Leaks: 0 181 + -Freed: 137 182 + -Reused: 124 183 + -Allocs: 13 184 + -Retain: 34 185 + +Leaks: 205 186 + +Freed: 0 187 + +Reused: 0 188 + +Allocs: 205 189 + +Retain: 0 190 + 191 + -Unifications: 113 192 + -Conjuncts: 209 193 + -Disjuncts: 171 194 + +Unifications: 161 195 + +Conjuncts: 240 196 + +Disjuncts: 32 87 197 -- out/eval/stats -- 88 198 Leaks: 0 89 - Freed: 117 90 - Reused: 104 199 + Freed: 137 200 + Reused: 124 91 201 Allocs: 13 92 - Retain: 27 202 + Retain: 34 93 203 94 - Unifications: 93 95 - Conjuncts: 181 96 - Disjuncts: 144 204 + Unifications: 113 205 + Conjuncts: 209 206 + Disjuncts: 171 97 207 -- out/evalalpha -- 98 208 (struct){ 99 209 issue3750: (struct){ ··· 204 314 } 205 315 a: (struct){ 206 316 b: (_){ _ } 317 + } 318 + } 319 + } 320 + } 321 + issue3780: (struct){ 322 + panic1: (_|_){ 323 + // [incomplete] issue3780.panic1: incomplete bool: bool: 324 + // ./issue3780.cue:5:10 325 + objs: (#struct){ 326 + } 327 + param!: (bool){ bool } 328 + #Objects: (#struct){ 329 + } 330 + } 331 + panic2: (struct){ 332 + parent: (struct){ 333 + objs: (#struct){ 334 + } 335 + param?: (bool){ bool } 336 + #Objects: (#struct){ 207 337 } 208 338 } 209 339 } ··· 407 537 } 408 538 a: (struct){ 409 539 b: (_){ _ } 540 + } 541 + } 542 + } 543 + } 544 + issue3780: (struct){ 545 + panic1: (_|_){ 546 + // [incomplete] issue3780.panic1: incomplete bool: bool: 547 + // ./issue3780.cue:5:10 548 + objs: (#struct){ 549 + } 550 + param!: (bool){ bool } 551 + #Objects: (#struct){ 552 + } 553 + } 554 + panic2: (struct){ 555 + parent: (struct){ 556 + objs: (#struct){ 557 + } 558 + param?: (bool){ bool } 559 + #Objects: (#struct){ 410 560 } 411 561 } 412 562 }