Skip to content

Commit 596fdc9

Browse files
committed
internal/core/adt: expand on permutations for test
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]>
1 parent 6774d0d commit 596fdc9

File tree

1 file changed

+107
-13
lines changed

1 file changed

+107
-13
lines changed

cue/testdata/basicrewrite/019_resolved_self-reference_cycles.txtar

+107-13
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,38 @@
33
#name: resolved self-reference cycles
44
#evalPartial
55
-- in.cue --
6-
a: b - 100
7-
b: a + 100
8-
b: 200
6+
math: p1: {
7+
a: b - 100
8+
b: a + 100
9+
b: 200
10+
}
11+
math: p2: {
12+
a: b - 100
13+
b: 200
14+
b: a + 100
15+
}
16+
math: p3: {
17+
b: a + 100
18+
a: b - 100
19+
b: 200
20+
}
21+
math: p4: {
22+
b: a + 100
23+
b: 200
24+
a: b - 100
25+
}
26+
math: p5: {
27+
b: 200
28+
b: a + 100
29+
a: b - 100
30+
}
31+
math: p6: {
32+
b: 200
33+
a: b - 100
34+
b: a + 100
35+
}
36+
37+
a: 100
938

1039
c: [c[1], a]
1140

@@ -69,9 +98,49 @@ s3:
6998
-- out/compile --
7099
--- in.cue
71100
{
72-
a: (〈0;b〉 - 100)
73-
b: (〈0;a〉 + 100)
74-
b: 200
101+
math: {
102+
p1: {
103+
a: (〈0;b〉 - 100)
104+
b: (〈0;a〉 + 100)
105+
b: 200
106+
}
107+
}
108+
math: {
109+
p2: {
110+
a: (〈0;b〉 - 100)
111+
b: 200
112+
b: (〈0;a〉 + 100)
113+
}
114+
}
115+
math: {
116+
p3: {
117+
b: (〈0;a〉 + 100)
118+
a: (〈0;b〉 - 100)
119+
b: 200
120+
}
121+
}
122+
math: {
123+
p4: {
124+
b: (〈0;a〉 + 100)
125+
b: 200
126+
a: (〈0;b〉 - 100)
127+
}
128+
}
129+
math: {
130+
p5: {
131+
b: 200
132+
b: (〈0;a〉 + 100)
133+
a: (〈0;b〉 - 100)
134+
}
135+
}
136+
math: {
137+
p6: {
138+
b: 200
139+
a: (〈0;b〉 - 100)
140+
b: (〈0;a〉 + 100)
141+
}
142+
}
143+
a: 100
75144
c: [
76145
〈1;c〉[1],
77146
〈1;a〉,
@@ -88,18 +157,43 @@ s3:
88157
}
89158
-- out/eval/stats --
90159
Leaks: 0
91-
Freed: 18
92-
Reused: 13
160+
Freed: 36
161+
Reused: 31
93162
Allocs: 5
94-
Retain: 4
163+
Retain: 9
95164

96-
Unifications: 18
97-
Conjuncts: 36
98-
Disjuncts: 21
165+
Unifications: 36
166+
Conjuncts: 61
167+
Disjuncts: 43
99168
-- out/eval --
100169
(struct){
170+
math: (struct){
171+
p1: (struct){
172+
a: (int){ 100 }
173+
b: (int){ 200 }
174+
}
175+
p2: (struct){
176+
a: (int){ 100 }
177+
b: (int){ 200 }
178+
}
179+
p3: (struct){
180+
b: (int){ 200 }
181+
a: (int){ 100 }
182+
}
183+
p4: (struct){
184+
b: (int){ 200 }
185+
a: (int){ 100 }
186+
}
187+
p5: (struct){
188+
b: (int){ 200 }
189+
a: (int){ 100 }
190+
}
191+
p6: (struct){
192+
b: (int){ 200 }
193+
a: (int){ 100 }
194+
}
195+
}
101196
a: (int){ 100 }
102-
b: (int){ 200 }
103197
c: (#list){
104198
0: (int){ 100 }
105199
1: (int){ 100 }

0 commit comments

Comments
 (0)