cuelang.org/go@v0.13.0/tools/trim/testdata/61.txtar (about)

     1  Variant of 26, but the point here is to show that when there's a tie
     2  between a conjunct a pattern and one from outside a pattern, the
     3  pattern will always win.
     4  
     5  This is because we simplify patterns in isolation. So regardless of
     6  the order in which we do the processing, we know that the pattern is
     7  reachable from the result root, and it must not be made more general,
     8  so the z: 5 from line 3 must survive. When we eventually visit b's z:
     9  5, we find the z: 5 conjuncts from both line 1 and line 3, but we know
    10  (either already or later on) that line 3 must survive, so line 1's is
    11  redundant.
    12  
    13  -- a.cue --
    14  b: w: x: y: z: 5
    15  b: a
    16  a: [string]: x: y: z: 5
    17  -- out/trim-v3 --
    18  == a.cue
    19  b: w: _
    20  b: a
    21  a: [string]: x: y: z: 5
    22  -- diff/-out/trim-v3<==>+out/trim --
    23  diff old new
    24  --- old
    25  +++ new
    26  @@ -1,4 +1,4 @@
    27   == a.cue
    28  -b: w: {}
    29  +b: w: _
    30   b: a
    31   a: [string]: x: y: z: 5
    32  -- out/trim-v3-noshare --
    33  == a.cue
    34  b: w: _
    35  b: a
    36  a: [string]: x: y: z: 5
    37  -- diff/-out/trim-v3-noshare<==>+out/trim --
    38  diff old new
    39  --- old
    40  +++ new
    41  @@ -1,4 +1,4 @@
    42   == a.cue
    43  -b: w: {}
    44  +b: w: _
    45   b: a
    46   a: [string]: x: y: z: 5
    47  -- out/trim --
    48  == a.cue
    49  b: w: {}
    50  b: a
    51  a: [string]: x: y: z: 5