Skip to content

Commit

Permalink
internal/core/validate: add test for issue 3651
Browse files Browse the repository at this point in the history
Issue #3651

Signed-off-by: Marcel van Lohuizen <mpvl@gmail.com>
Change-Id: I0f2755389bc954828dbc11d4dd53fd4b5eb72c17
Dispatch-Trailer: {"type":"trybot","CL":1206949,"patchset":1,"ref":"refs/changes/49/1206949/1","targetBranch":"master"}
  • Loading branch information
mpvl authored and cueckoo committed Jan 9, 2025
1 parent 4acd563 commit f125b48
Showing 1 changed file with 87 additions and 22 deletions.
109 changes: 87 additions & 22 deletions cue/testdata/cycle/builtins.txtar
Original file line number Diff line number Diff line change
Expand Up @@ -126,50 +126,57 @@ issue3443: {
fail: #S: matchN(1, [{n: #S}]) & {n: n: n: _}
}
}
issue3633: final: {
// With nested matchNs as below, the schema will become an incomplete error
// as a value of the root vertex. Make sure this edge case is properly
// handled.
data: {} & #s
#s: matchN(1, [matchN(1, [{a!: _}])])
}
-- todo/p1 --
issue3443.noCycle: fix hang
-- out/evalalpha/stats --
Leaks: 193
Leaks: 211
Freed: 17
Reused: 17
Allocs: 193
Allocs: 211
Retain: 0

Unifications: 167
Conjuncts: 657
Unifications: 183
Conjuncts: 696
Disjuncts: 28
-- diff/-out/evalalpha/stats<==>+out/eval/stats --
diff old new
--- old
+++ new
@@ -1,9 +1,9 @@
-Leaks: 12
-Freed: 235
-Reused: 218
-Leaks: 14
-Freed: 249
-Reused: 234
-Allocs: 29
-Retain: 65
+Leaks: 193
-Retain: 70
+Leaks: 211
+Freed: 17
+Reused: 17
+Allocs: 193
+Allocs: 211
+Retain: 0

-Unifications: 211
-Conjuncts: 389
-Disjuncts: 290
+Unifications: 167
+Conjuncts: 657
-Unifications: 227
-Conjuncts: 413
-Disjuncts: 309
+Unifications: 183
+Conjuncts: 696
+Disjuncts: 28
-- out/eval/stats --
Leaks: 12
Freed: 235
Reused: 218
Leaks: 14
Freed: 249
Reused: 234
Allocs: 29
Retain: 65
Retain: 70

Unifications: 211
Conjuncts: 389
Disjuncts: 290
Unifications: 227
Conjuncts: 413
Disjuncts: 309
-- out/evalalpha --
Errors:
issue3443.matchIf.#S: cannot call non-function matchIf (type struct):
Expand Down Expand Up @@ -350,6 +357,20 @@ Result:
}
}
}
issue3633: (struct){
final: (struct){
data: (#struct){
}
#s: (_){ matchN(1, (#list){
0: (_|_){// &[matchN(1, [
// {
// a!: _
// },
// ])]
}
}) }
}
}
}
-- diff/-out/evalalpha<==>+out/eval --
diff old new
Expand Down Expand Up @@ -476,6 +497,24 @@ diff old new
n: (struct){
n: (_){ _ }
}
@@ -167,14 +179,14 @@
}
issue3633: (struct){
final: (struct){
- data: (struct){
+ data: (#struct){
}
#s: (_){ matchN(1, (#list){
- 0: (_|_){// matchN(1, [
+ 0: (_|_){// &[matchN(1, [
// {
// a!: _
// },
- // ])
+ // ])]
}
}) }
}
-- diff/todo/p2 --
issue3443: Sort out differences in reporting of cycles.
-- out/eval --
Expand Down Expand Up @@ -646,6 +685,20 @@ Result:
}
}
}
issue3633: (struct){
final: (struct){
data: (struct){
}
#s: (_){ matchN(1, (#list){
0: (_|_){// matchN(1, [
// {
// a!: _
// },
// ])
}
}) }
}
}
}
-- out/compile --
--- in.cue
Expand Down Expand Up @@ -786,4 +839,16 @@ Result:
}
}
}
issue3633: {
final: {
data: ({} & 〈0;#s〉)
#s: matchN(1, [
matchN(1, [
{
a!: _
},
]),
])
}
}
}

0 comments on commit f125b48

Please sign in to comment.