Skip to content

Commit 62a5dd0

Browse files
committed
internal/core/adt: add tests for 3770
Issue #3770 Signed-off-by: Marcel van Lohuizen <[email protected]> Change-Id: I3fd591afc05f8661140cfd1fcc44ec79f2030199 Reviewed-on: https://review.gerrithub.io/c/cue-lang/cue/+/1211752 Reviewed-by: Daniel Martí <[email protected]> TryBot-Result: CUEcueckoo <[email protected]> Unity-Result: CUE porcuepine <[email protected]>
1 parent 4172469 commit 62a5dd0

File tree

1 file changed

+103
-22
lines changed

1 file changed

+103
-22
lines changed

cue/testdata/eval/counters.txtar

+103-22
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,18 @@ issue3780: panic2: {
6767
}
6868
}
6969
}
70+
-- issue3770.cue --
71+
issue3770: task: {
72+
m: {
73+
let t = ["x"]
74+
for m in t {
75+
(m): a: 1
76+
}
77+
x: b: 1
78+
}
79+
m: null | { }
80+
out: m.x.a
81+
}
7082
-- out/compile --
7183
--- issue3750.cue
7284
{
@@ -117,6 +129,28 @@ issue3780: panic2: {
117129
}
118130
}
119131
}
132+
--- issue3770.cue
133+
{
134+
issue3770: {
135+
task: {
136+
m: {
137+
let t#1 = [
138+
"x",
139+
]
140+
for _, m in 〈0;let t#1〉 {
141+
〈1;m〉: {
142+
a: 1
143+
}
144+
}
145+
x: {
146+
b: 1
147+
}
148+
}
149+
m: (null|{})
150+
out: 〈0;m〉.x.a
151+
}
152+
}
153+
}
120154
--- issue3780.cue
121155
{
122156
issue3780: {
@@ -163,47 +197,47 @@ issue3780: panic2: {
163197
}
164198
}
165199
-- out/evalalpha/stats --
166-
Leaks: 205
200+
Leaks: 225
167201
Freed: 0
168202
Reused: 0
169-
Allocs: 205
203+
Allocs: 225
170204
Retain: 0
171205

172-
Unifications: 161
173-
Conjuncts: 240
174-
Disjuncts: 32
206+
Unifications: 172
207+
Conjuncts: 257
208+
Disjuncts: 34
175209
-- diff/-out/evalalpha/stats<==>+out/eval/stats --
176210
diff old new
177211
--- old
178212
+++ new
179213
@@ -1,9 +1,9 @@
180214
-Leaks: 0
181-
-Freed: 137
182-
-Reused: 124
215+
-Freed: 151
216+
-Reused: 138
183217
-Allocs: 13
184-
-Retain: 34
185-
+Leaks: 205
218+
-Retain: 35
219+
+Leaks: 225
186220
+Freed: 0
187221
+Reused: 0
188-
+Allocs: 205
222+
+Allocs: 225
189223
+Retain: 0
190224

191-
-Unifications: 113
192-
-Conjuncts: 209
193-
-Disjuncts: 171
194-
+Unifications: 161
195-
+Conjuncts: 240
196-
+Disjuncts: 32
225+
-Unifications: 125
226+
-Conjuncts: 229
227+
-Disjuncts: 186
228+
+Unifications: 172
229+
+Conjuncts: 257
230+
+Disjuncts: 34
197231
-- out/eval/stats --
198232
Leaks: 0
199-
Freed: 137
200-
Reused: 124
233+
Freed: 151
234+
Reused: 138
201235
Allocs: 13
202-
Retain: 34
236+
Retain: 35
203237

204-
Unifications: 113
205-
Conjuncts: 209
206-
Disjuncts: 171
238+
Unifications: 125
239+
Conjuncts: 229
240+
Disjuncts: 186
207241
-- out/evalalpha --
208242
(struct){
209243
issue3750: (struct){
@@ -318,6 +352,22 @@ Disjuncts: 171
318352
}
319353
}
320354
}
355+
issue3770: (struct){
356+
task: (struct){
357+
m: (struct){
358+
let t#1 = (#list){
359+
0: (string){ "x" }
360+
}
361+
x: (struct){
362+
b: (int){ 1 }
363+
}
364+
}
365+
out: (_|_){
366+
// [incomplete] issue3770.task.out: undefined field: a:
367+
// ./issue3770.cue:10:11
368+
}
369+
}
370+
}
321371
issue3780: (struct){
322372
panic1: (_|_){
323373
// [incomplete] issue3780.panic1: incomplete bool: bool:
@@ -451,6 +501,23 @@ diff old new
451501
a: (struct){
452502
b: (_){ _ }
453503
}
504+
@@ -95,10 +119,12 @@
505+
}
506+
x: (struct){
507+
b: (int){ 1 }
508+
- a: (int){ 1 }
509+
- }
510+
- }
511+
- out: (int){ 1 }
512+
+ }
513+
+ }
514+
+ out: (_|_){
515+
+ // [incomplete] issue3770.task.out: undefined field: a:
516+
+ // ./issue3770.cue:10:11
517+
+ }
518+
}
519+
}
520+
issue3780: (struct){
454521
-- out/eval --
455522
(struct){
456523
issue3750: (struct){
@@ -541,6 +608,20 @@ diff old new
541608
}
542609
}
543610
}
611+
issue3770: (struct){
612+
task: (struct){
613+
m: (struct){
614+
let t#1 = (#list){
615+
0: (string){ "x" }
616+
}
617+
x: (struct){
618+
b: (int){ 1 }
619+
a: (int){ 1 }
620+
}
621+
}
622+
out: (int){ 1 }
623+
}
624+
}
544625
issue3780: (struct){
545626
panic1: (_|_){
546627
// [incomplete] issue3780.panic1: incomplete bool: bool:

0 commit comments

Comments
 (0)