Skip to content

Commit 0be3c85

Browse files
committed
cue/testdata: add a regression test for issue 2526
This CUE caused a hang on evalv2, but correctly reports a structural cycle on evalv3 now. Closes #2526. Signed-off-by: Daniel Martí <[email protected]> Change-Id: I15b0d0950bc48943cbe6c5253c82feaaa9936800 Reviewed-on: https://review.gerrithub.io/c/cue-lang/cue/+/1214546 Unity-Result: CUE porcuepine <[email protected]> Reviewed-by: Matthew Sackman <[email protected]> TryBot-Result: CUEcueckoo <[email protected]>
1 parent 6204a0a commit 0be3c85

File tree

1 file changed

+34
-0
lines changed

1 file changed

+34
-0
lines changed

cue/testdata/cycle/issue2526.txtar

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
// This code caused a hang on evalv2.
2+
#skip-v2
3+
-- in.cue --
4+
x
5+
x: {
6+
y
7+
y: x
8+
}
9+
-- out/compile --
10+
--- in.cue
11+
{
12+
〈0;x〉
13+
x: {
14+
〈0;y〉
15+
y: 〈1;x〉
16+
}
17+
}
18+
-- out/evalalpha --
19+
Errors:
20+
x.y: structural cycle
21+
22+
Result:
23+
(_|_){
24+
// [structural cycle]
25+
x: (_|_){
26+
// [structural cycle]
27+
y: (_|_){
28+
// [structural cycle] x.y: structural cycle
29+
}
30+
}
31+
y: (_|_){
32+
// [structural cycle]
33+
}
34+
}

0 commit comments

Comments
 (0)