Skip to content

Commit

Permalink
cue/testdata: polish test before implementing disjunctions
Browse files Browse the repository at this point in the history
This limits the diffs down the line.

Signed-off-by: Marcel van Lohuizen <[email protected]>
Change-Id: I2226923f145061e28022316fb1ee41801a067d97
Reviewed-on: https://review.gerrithub.io/c/cue-lang/cue/+/1191561
Unity-Result: CUE porcuepine <[email protected]>
TryBot-Result: CUEcueckoo <[email protected]>
Reviewed-by: Daniel Martí <[email protected]>
  • Loading branch information
mpvl committed Apr 8, 2024
1 parent 9cdee62 commit 20b1c3a
Showing 1 changed file with 22 additions and 16 deletions.
38 changes: 22 additions & 16 deletions cue/testdata/disjunctions/defembed.txtar
Original file line number Diff line number Diff line change
Expand Up @@ -25,18 +25,20 @@ y4: x & {

// Second disjunct in embedding is not possible because of previous declaration
// of `b`, so it should be resolved to {a: 1}.
b: (*"a" | "b") | "c"
{a: b} | {b: int}
z: {
b: (*"a" | "b") | "c"
{a: b} | {b: int}
}
-- out/eval/stats --
Leaks: 0
Freed: 306
Reused: 296
Allocs: 10
Freed: 163
Reused: 155
Allocs: 8
Retain: 0

Unifications: 52
Conjuncts: 373
Disjuncts: 306
Unifications: 29
Conjuncts: 198
Disjuncts: 163
-- out/eval --
(struct){
x: (struct){
Expand Down Expand Up @@ -68,8 +70,10 @@ Disjuncts: 306
m3: (int){ |(*(int){ 2 }, (int){ 3 }) }
m4: (int){ 6 }
}
b: (string){ |(*(string){ "a" }, (string){ "b" }, (string){ "c" }) }
a: (string){ |(*(string){ "a" }, (string){ "b" }, (string){ "c" }) }
z: (struct){
b: (string){ |(*(string){ "a" }, (string){ "b" }, (string){ "c" }) }
a: (string){ |(*(string){ "a" }, (string){ "b" }, (string){ "c" }) }
}
}
-- out/compile --
--- in.cue
Expand Down Expand Up @@ -101,10 +105,12 @@ Disjuncts: 306
m4: ((〈2;y4〉.m1 + 〈2;y4〉.m2) + 〈2;y4〉.m3)
}
})
b: ((*"a"|"b")|"c")
({
a: 〈1;b〉
}|{
b: int
})
z: {
b: ((*"a"|"b")|"c")
({
a: 〈1;b〉
}|{
b: int
})
}
}

0 comments on commit 20b1c3a

Please sign in to comment.