Skip to content

Commit

Permalink
internal/core/adt: expand on permutations for test
Browse files Browse the repository at this point in the history
Ensure this works for all permutations.

Signed-off-by: Marcel van Lohuizen <[email protected]>
Change-Id: I08e0da9872a1b06cab38c9d9929600d173b646ea
Reviewed-on: https://review.gerrithub.io/c/cue-lang/cue/+/1172010
TryBot-Result: CUEcueckoo <[email protected]>
Reviewed-by: Daniel Martí <[email protected]>
  • Loading branch information
mpvl committed Nov 29, 2023
1 parent 6774d0d commit 596fdc9
Showing 1 changed file with 107 additions and 13 deletions.
120 changes: 107 additions & 13 deletions cue/testdata/basicrewrite/019_resolved_self-reference_cycles.txtar
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,38 @@
#name: resolved self-reference cycles
#evalPartial
-- in.cue --
a: b - 100
b: a + 100
b: 200
math: p1: {
a: b - 100
b: a + 100
b: 200
}
math: p2: {
a: b - 100
b: 200
b: a + 100
}
math: p3: {
b: a + 100
a: b - 100
b: 200
}
math: p4: {
b: a + 100
b: 200
a: b - 100
}
math: p5: {
b: 200
b: a + 100
a: b - 100
}
math: p6: {
b: 200
a: b - 100
b: a + 100
}

a: 100

c: [c[1], a]

Expand Down Expand Up @@ -69,9 +98,49 @@ s3:
-- out/compile --
--- in.cue
{
a: (〈0;b〉 - 100)
b: (〈0;a〉 + 100)
b: 200
math: {
p1: {
a: (〈0;b〉 - 100)
b: (〈0;a〉 + 100)
b: 200
}
}
math: {
p2: {
a: (〈0;b〉 - 100)
b: 200
b: (〈0;a〉 + 100)
}
}
math: {
p3: {
b: (〈0;a〉 + 100)
a: (〈0;b〉 - 100)
b: 200
}
}
math: {
p4: {
b: (〈0;a〉 + 100)
b: 200
a: (〈0;b〉 - 100)
}
}
math: {
p5: {
b: 200
b: (〈0;a〉 + 100)
a: (〈0;b〉 - 100)
}
}
math: {
p6: {
b: 200
a: (〈0;b〉 - 100)
b: (〈0;a〉 + 100)
}
}
a: 100
c: [
〈1;c〉[1],
〈1;a〉,
Expand All @@ -88,18 +157,43 @@ s3:
}
-- out/eval/stats --
Leaks: 0
Freed: 18
Reused: 13
Freed: 36
Reused: 31
Allocs: 5
Retain: 4
Retain: 9

Unifications: 18
Conjuncts: 36
Disjuncts: 21
Unifications: 36
Conjuncts: 61
Disjuncts: 43
-- out/eval --
(struct){
math: (struct){
p1: (struct){
a: (int){ 100 }
b: (int){ 200 }
}
p2: (struct){
a: (int){ 100 }
b: (int){ 200 }
}
p3: (struct){
b: (int){ 200 }
a: (int){ 100 }
}
p4: (struct){
b: (int){ 200 }
a: (int){ 100 }
}
p5: (struct){
b: (int){ 200 }
a: (int){ 100 }
}
p6: (struct){
b: (int){ 200 }
a: (int){ 100 }
}
}
a: (int){ 100 }
b: (int){ 200 }
c: (#list){
0: (int){ 100 }
1: (int){ 100 }
Expand Down

0 comments on commit 596fdc9

Please sign in to comment.