From 20b1c3a7dca3936d5a82b0c740da573d23d94fff Mon Sep 17 00:00:00 2001 From: Marcel van Lohuizen Date: Thu, 4 Apr 2024 10:36:45 +0200 Subject: [PATCH] cue/testdata: polish test before implementing disjunctions MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This limits the diffs down the line. Signed-off-by: Marcel van Lohuizen Change-Id: I2226923f145061e28022316fb1ee41801a067d97 Reviewed-on: https://review.gerrithub.io/c/cue-lang/cue/+/1191561 Unity-Result: CUE porcuepine TryBot-Result: CUEcueckoo Reviewed-by: Daniel Martí --- cue/testdata/disjunctions/defembed.txtar | 38 ++++++++++++++---------- 1 file changed, 22 insertions(+), 16 deletions(-) diff --git a/cue/testdata/disjunctions/defembed.txtar b/cue/testdata/disjunctions/defembed.txtar index b6bd5802a38..d76a91a7d16 100644 --- a/cue/testdata/disjunctions/defembed.txtar +++ b/cue/testdata/disjunctions/defembed.txtar @@ -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){ @@ -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 @@ -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 + }) + } }