Skip to content

Commit 09dee80

Browse files
committed
cue/testdata: add a regression test for issue 1640
a1.cue used to work and a2.cue used to fail as of April 2022. They now both succeed on either evalv2 or evalv3. Closes #1640. Signed-off-by: Daniel Martí <[email protected]> Change-Id: I8ce1940b4d5cdde9ddb5457db9ad0e1dd4133cb6 Reviewed-on: https://review.gerrithub.io/c/cue-lang/cue/+/1214406 Unity-Result: CUE porcuepine <[email protected]> Reviewed-by: Matthew Sackman <[email protected]> TryBot-Result: CUEcueckoo <[email protected]>
1 parent 8f552be commit 09dee80

File tree

1 file changed

+115
-0
lines changed

1 file changed

+115
-0
lines changed

cue/testdata/eval/issue1640.txtar

Lines changed: 115 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,115 @@
1+
-- a1.cue --
2+
package bug
3+
4+
y: fact2.uc
5+
x: fact1.uc
6+
-- a2.cue --
7+
package bug
8+
9+
x: fact1.uc
10+
y: fact2.uc
11+
-- x.cue --
12+
package bug
13+
14+
fact1: #MCS & {
15+
lc: fact2.lc
16+
}
17+
fact2: #MCS & {
18+
lc: "foo"
19+
}
20+
21+
#MCS: #MultiCaseString
22+
#MultiCaseString: {
23+
lc: string
24+
uc: lc
25+
}
26+
-- out/compile --
27+
--- a1.cue
28+
{
29+
y: 〈0;fact2〉.uc
30+
x: 〈0;fact1〉.uc
31+
}
32+
--- a2.cue
33+
{
34+
x: 〈0;fact1〉.uc
35+
y: 〈0;fact2〉.uc
36+
}
37+
--- x.cue
38+
{
39+
fact1: (〈0;#MCS〉 & {
40+
lc: 〈1;fact2〉.lc
41+
})
42+
fact2: (〈0;#MCS〉 & {
43+
lc: "foo"
44+
})
45+
#MCS: 〈0;#MultiCaseString〉
46+
#MultiCaseString: {
47+
lc: string
48+
uc: 〈0;lc〉
49+
}
50+
}
51+
-- out/eval/stats --
52+
Leaks: 0
53+
Freed: 15
54+
Reused: 8
55+
Allocs: 7
56+
Retain: 21
57+
58+
Unifications: 15
59+
Conjuncts: 45
60+
Disjuncts: 31
61+
-- out/evalalpha --
62+
(struct){
63+
y: (string){ "foo" }
64+
x: (string){ "foo" }
65+
fact1: (#struct){
66+
lc: (string){ "foo" }
67+
uc: (string){ "foo" }
68+
}
69+
fact2: (#struct){
70+
lc: (string){ "foo" }
71+
uc: (string){ "foo" }
72+
}
73+
#MCS: ~(#MultiCaseString)
74+
#MultiCaseString: (#struct){
75+
lc: (string){ string }
76+
uc: (string){ string }
77+
}
78+
}
79+
-- diff/-out/evalalpha<==>+out/eval --
80+
diff old new
81+
--- old
82+
+++ new
83+
@@ -9,10 +9,7 @@
84+
lc: (string){ "foo" }
85+
uc: (string){ "foo" }
86+
}
87+
- #MCS: (#struct){
88+
- lc: (string){ string }
89+
- uc: (string){ string }
90+
- }
91+
+ #MCS: ~(#MultiCaseString)
92+
#MultiCaseString: (#struct){
93+
lc: (string){ string }
94+
uc: (string){ string }
95+
-- out/eval --
96+
(struct){
97+
y: (string){ "foo" }
98+
x: (string){ "foo" }
99+
fact1: (#struct){
100+
lc: (string){ "foo" }
101+
uc: (string){ "foo" }
102+
}
103+
fact2: (#struct){
104+
lc: (string){ "foo" }
105+
uc: (string){ "foo" }
106+
}
107+
#MCS: (#struct){
108+
lc: (string){ string }
109+
uc: (string){ string }
110+
}
111+
#MultiCaseString: (#struct){
112+
lc: (string){ string }
113+
uc: (string){ string }
114+
}
115+
}

0 commit comments

Comments
 (0)