this repo has no description
0
fork

Configure Feed

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

cue/testdata: add a regression test for issue #3842

We panicked with a stack overflow before https://cuelang.org/cl/1218185.

Closes #3842.

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

+53 -16
+53 -16
cue/testdata/cycle/builtins.txtar
··· 133 133 data: {} & #s 134 134 #s: matchN(1, [matchN(1, [{a!: _}])]) 135 135 } 136 + issue3842: reduced: { 137 + #recursive: [...matchIf({ 138 + source?: "multi" 139 + }, #recursive, _) & { 140 + source?: string 141 + }] 142 + } 136 143 -- cycle.cue -- 137 144 import "strconv" 138 145 ··· 246 253 247 254 issue3634: full: { 248 255 #Schema: { 249 - required?: [...string] 256 + required?: [...string] 250 257 properties?: [string]: null | #Schema 251 258 } 252 259 ··· 279 286 } 280 287 -- out/evalalpha/stats -- 281 288 Leaks: 48 282 - Freed: 461 283 - Reused: 431 284 - Allocs: 78 289 + Freed: 464 290 + Reused: 433 291 + Allocs: 79 285 292 Retain: 0 286 293 287 - Unifications: 427 288 - Conjuncts: 756 294 + Unifications: 430 295 + Conjuncts: 759 289 296 Disjuncts: 30 290 297 Notifications: 2 291 298 ··· 305 312 -Conjuncts: 821 306 313 -Disjuncts: 537 307 314 +Leaks: 48 308 - +Freed: 461 309 - +Reused: 431 310 - +Allocs: 78 315 + +Freed: 464 316 + +Reused: 433 317 + +Allocs: 79 311 318 +Retain: 0 312 319 + 313 - +Unifications: 427 314 - +Conjuncts: 756 320 + +Unifications: 430 321 + +Conjuncts: 759 315 322 +Disjuncts: 30 316 323 +Notifications: 2 317 324 + ··· 815 822 // ]) 816 823 } 817 824 }) } 825 + } 826 + } 827 + issue3842: (struct){ 828 + reduced: (struct){ 829 + #recursive: (list){ 830 + } 818 831 } 819 832 } 820 833 yamlNoCycle: (struct){ ··· 1272 1285 } 1273 1286 #s: (_){ matchN(1, (#list){ 1274 1287 0: (_|_){// matchN(1, [ 1275 - @@ -417,8 +494,8 @@ 1288 + @@ -411,6 +488,12 @@ 1289 + }) } 1290 + } 1291 + } 1292 + + issue3842: (struct){ 1293 + + reduced: (struct){ 1294 + + #recursive: (list){ 1295 + + } 1296 + + } 1297 + + } 1298 + yamlNoCycle: (struct){ 1299 + #c: (#struct){ 1300 + b?: (string){ string } 1301 + @@ -417,8 +500,8 @@ 1276 1302 a?: ((string|bytes)){ "encoding/yaml".Validate(yamlNoCycle.#c) } 1277 1303 } 1278 1304 data: (#struct){ ··· 1282 1308 } 1283 1309 } 1284 1310 selfCycle: (_|_){ 1285 - @@ -446,19 +523,8 @@ 1311 + @@ -446,19 +529,8 @@ 1286 1312 } 1287 1313 } 1288 1314 } ··· 1304 1330 } 1305 1331 } 1306 1332 yamlVal: (_|_){ 1307 - @@ -466,25 +532,33 @@ 1333 + @@ -466,25 +538,33 @@ 1308 1334 t1: (_|_){ 1309 1335 // [structural cycle] 1310 1336 x: (_|_){ ··· 1352 1378 } 1353 1379 } 1354 1380 t2: (_|_){ 1355 - @@ -492,13 +566,16 @@ 1381 + @@ -492,13 +572,16 @@ 1356 1382 z: (_|_){ 1357 1383 // [structural cycle] 1358 1384 y: (_|_){ ··· 1376 1402 } 1377 1403 } 1378 1404 } 1379 - @@ -505,8 +582,12 @@ 1405 + @@ -505,8 +588,12 @@ 1380 1406 yamlValidatePartial: (_|_){ 1381 1407 // [structural cycle] 1382 1408 x: (_|_){ ··· 2246 2272 }, 2247 2273 ]), 2248 2274 ]) 2275 + } 2276 + } 2277 + issue3842: { 2278 + reduced: { 2279 + #recursive: [ 2280 + ...(matchIf({ 2281 + source?: "multi" 2282 + }, 〈1;#recursive〉, _) & { 2283 + source?: string 2284 + }), 2285 + ] 2249 2286 } 2250 2287 } 2251 2288 }