Skip to content

Commit d57d885

Browse files
committed
internal/core/adt: add tests for 3672 and 3606
These tests have the same fix, which will be addressed in a different CL. The issues with these tests only manifest themselves with DebugDeps enabled. So we therefore disable it to ensure the problem is exposed. Disabling DebugDeps has the side effect to cause the counter checks in EvalAlpha to fail. We therefore also add a check to disable those checks. We could have opted to set an option for the tests to run with DebugDeps disabled. However, the solution to the bug is to make the use of "dependencies" official and not disable them if DebugDeps is disabled. We therefore keep DebugDeps off in the transition, after which it can be enabled again. Notice that this also changes some other tests. We will address these in the fix as well. Issue #3606 Issue #3672 Signed-off-by: Marcel van Lohuizen <[email protected]> Change-Id: I73b0b9925806fae94b0c6da6faf3dd50db500d27 Reviewed-on: https://gerrithub.io/c/cue-lang/cue/+/1207313 Unity-Result: CUE porcuepine <[email protected]> Reviewed-by: Daniel Martí <[email protected]> TryBot-Result: CUEcueckoo <[email protected]>
1 parent fbfff68 commit d57d885

File tree

5 files changed

+605
-166
lines changed

5 files changed

+605
-166
lines changed

cue/testdata/cycle/comprehension.txtar

+132-35
Original file line numberDiff line numberDiff line change
@@ -310,15 +310,15 @@ issue2367: {
310310
}
311311

312312
-- out/evalalpha/stats --
313-
Leaks: 782
314-
Freed: 63
315-
Reused: 63
316-
Allocs: 782
313+
Leaks: 795
314+
Freed: 56
315+
Reused: 56
316+
Allocs: 795
317317
Retain: 0
318318

319-
Unifications: 502
320-
Conjuncts: 3031
321-
Disjuncts: 196
319+
Unifications: 506
320+
Conjuncts: 3038
321+
Disjuncts: 198
322322
-- out/evalalpha --
323323
Errors:
324324
selfReferential.insertionError.A: adding field foo3 not allowed as field set was already referenced:
@@ -450,11 +450,31 @@ Result:
450450
acrossOr: (struct){
451451
t1: (struct){
452452
p1: (struct){
453-
o: (#struct){
454-
retry: (#struct){
455-
reject: (string){ "ok" }
456-
}
457-
}
453+
o: (#struct){ |((#struct){
454+
retry: (struct){
455+
reject: (string){ "ok" }
456+
}
457+
reject: (string){ string }
458+
}, (#struct){
459+
retry: (struct){
460+
reject: (string){ "ok" }
461+
}
462+
resource: (string){ string }
463+
}, (#struct){
464+
retry: (#struct){ |((#struct){
465+
reject: (string){ "ok" }
466+
}, (#struct){
467+
reject: (string){ "ok" }
468+
resource: (string){ string }
469+
}, (#struct){
470+
reject: (string){ "ok" }
471+
retry: (#struct){ |((#struct){
472+
reject: (string){ string }
473+
}, (#struct){
474+
resource: (string){ string }
475+
}) }
476+
}) }
477+
}) }
458478
#AllOutputs: (#struct){
459479
reject: (string){ string }
460480
resource: (string){ string }
@@ -568,13 +588,33 @@ Result:
568588
}
569589
issue1881: (struct){
570590
p1: (struct){
571-
o: (#struct){
572-
retry: (struct){
573-
output: (#struct){
574-
reject: (string){ "ok" }
591+
o: (#struct){ |((#struct){
592+
retry: (struct){
593+
output: (struct){
594+
reject: (string){ "ok" }
595+
}
575596
}
576-
}
577-
}
597+
reject: (string){ string }
598+
}, (#struct){
599+
retry: (struct){
600+
output: (struct){
601+
reject: (string){ "ok" }
602+
}
603+
}
604+
resource: (string){ string }
605+
}, (#struct){
606+
retry: (struct){
607+
output: (#struct){ |((#struct){
608+
reject: (string){ "ok" }
609+
}, (#struct){
610+
reject: (string){ "ok" }
611+
resource: (string){ string }
612+
}, (#struct){
613+
reject: (string){ "ok" }
614+
retry: ~(issue1881.p1.#AllOutputs.retry)
615+
}) }
616+
}
617+
}) }
578618
#AllOutputs: (#struct){
579619
reject: (string){ string }
580620
resource: (string){ string }
@@ -778,7 +818,7 @@ diff old new
778818
}
779819
}
780820
}
781-
@@ -127,9 +120,9 @@
821+
@@ -127,19 +120,39 @@
782822
insertionError: (_|_){
783823
// [eval]
784824
A: (_|_){
@@ -790,10 +830,46 @@ diff old new
790830
}
791831
}
792832
acrossOr: (struct){
793-
@@ -254,27 +247,31 @@
833+
t1: (struct){
834+
p1: (struct){
835+
- o: (#struct){
836+
- retry: (#struct){
837+
- reject: (string){ "ok" }
838+
- }
839+
- }
840+
+ o: (#struct){ |((#struct){
841+
+ retry: (struct){
842+
+ reject: (string){ "ok" }
843+
+ }
844+
+ reject: (string){ string }
845+
+ }, (#struct){
846+
+ retry: (struct){
847+
+ reject: (string){ "ok" }
848+
+ }
849+
+ resource: (string){ string }
850+
+ }, (#struct){
851+
+ retry: (#struct){ |((#struct){
852+
+ reject: (string){ "ok" }
853+
+ }, (#struct){
854+
+ reject: (string){ "ok" }
855+
+ resource: (string){ string }
856+
+ }, (#struct){
857+
+ reject: (string){ "ok" }
858+
+ retry: (#struct){ |((#struct){
859+
+ reject: (string){ string }
860+
+ }, (#struct){
861+
+ resource: (string){ string }
862+
+ }) }
863+
+ }) }
864+
+ }) }
865+
#AllOutputs: (#struct){
866+
reject: (string){ string }
867+
resource: (string){ string }
868+
@@ -253,28 +266,52 @@
869+
}
794870
issue1881: (struct){
795871
p1: (struct){
796-
o: (#struct){
872+
- o: (#struct){
797873
- retry: (#struct){
798874
- output: (#struct){
799875
- reject: (string){ "ok" }
@@ -815,12 +891,33 @@ diff old new
815891
- reject: (string){ string }
816892
- }, (#struct){
817893
- resource: (string){ string }
818-
+ retry: (struct){
819-
+ output: (#struct){
820-
+ reject: (string){ "ok" }
894+
+ o: (#struct){ |((#struct){
895+
+ retry: (struct){
896+
+ output: (struct){
897+
+ reject: (string){ "ok" }
898+
+ }
821899
+ }
822-
+ }
823-
+ }
900+
+ reject: (string){ string }
901+
+ }, (#struct){
902+
+ retry: (struct){
903+
+ output: (struct){
904+
+ reject: (string){ "ok" }
905+
+ }
906+
+ }
907+
+ resource: (string){ string }
908+
+ }, (#struct){
909+
+ retry: (struct){
910+
+ output: (#struct){ |((#struct){
911+
+ reject: (string){ "ok" }
912+
+ }, (#struct){
913+
+ reject: (string){ "ok" }
914+
+ resource: (string){ string }
915+
+ }, (#struct){
916+
+ reject: (string){ "ok" }
917+
+ retry: ~(issue1881.p1.#AllOutputs.retry)
918+
+ }) }
919+
+ }
920+
+ }) }
824921
+ #AllOutputs: (#struct){
825922
+ reject: (string){ string }
826923
+ resource: (string){ string }
@@ -843,7 +940,7 @@ diff old new
843940
}) }
844941
}
845942
p2: (struct){
846-
@@ -290,7 +287,7 @@
943+
@@ -290,7 +327,7 @@
847944
}
848945
}
849946
o: (#struct){
@@ -852,7 +949,7 @@ diff old new
852949
output: (#struct){
853950
reject: (string){ "ok" }
854951
}
855-
@@ -320,7 +317,7 @@
952+
@@ -320,7 +357,7 @@
856953
resource: (string){ string }
857954
}) }
858955
o: (#struct){
@@ -871,18 +968,18 @@ diff old new
871968
-Reused: 1260
872969
-Allocs: 60
873970
-Retain: 145
874-
+Leaks: 782
875-
+Freed: 63
876-
+Reused: 63
877-
+Allocs: 782
971+
+Leaks: 795
972+
+Freed: 56
973+
+Reused: 56
974+
+Allocs: 795
878975
+Retain: 0
879976

880977
-Unifications: 832
881978
-Conjuncts: 2525
882979
-Disjuncts: 1404
883-
+Unifications: 502
884-
+Conjuncts: 3031
885-
+Disjuncts: 196
980+
+Unifications: 506
981+
+Conjuncts: 3038
982+
+Disjuncts: 198
886983
-- out/eval/stats --
887984
Leaks: 50
888985
Freed: 1270

cue/testdata/cycle/issue990.txtar

+14-14
Original file line numberDiff line numberDiff line change
@@ -80,15 +80,15 @@ out: #sub & {#p: _test.s1}
8080
-- diff/todo/p3 --
8181
Reordering
8282
-- out/evalalpha/stats --
83-
Leaks: 1834
84-
Freed: 197
85-
Reused: 197
86-
Allocs: 1834
83+
Leaks: 1909
84+
Freed: 204
85+
Reused: 204
86+
Allocs: 1909
8787
Retain: 0
8888

89-
Unifications: 243
90-
Conjuncts: 4474
91-
Disjuncts: 396
89+
Unifications: 257
90+
Conjuncts: 4823
91+
Disjuncts: 410
9292
-- out/evalalpha --
9393
(struct){
9494
#AC: (#struct){
@@ -328,18 +328,18 @@ diff old new
328328
-Reused: 3213
329329
-Allocs: 25
330330
-Retain: 26
331-
+Leaks: 1834
332-
+Freed: 197
333-
+Reused: 197
334-
+Allocs: 1834
331+
+Leaks: 1909
332+
+Freed: 204
333+
+Reused: 204
334+
+Allocs: 1909
335335
+Retain: 0
336336

337337
-Unifications: 2588
338338
-Conjuncts: 12056
339339
-Disjuncts: 3258
340-
+Unifications: 243
341-
+Conjuncts: 4474
342-
+Disjuncts: 396
340+
+Unifications: 257
341+
+Conjuncts: 4823
342+
+Disjuncts: 410
343343
-- diff/-out/evalalpha<==>+out/eval --
344344
diff old new
345345
--- old

0 commit comments

Comments
 (0)