github.com/solo-io/cue@v0.4.7/cue/testdata/resolve/009_optional_field_unification.txtar (about)

     1  # DO NOT EDIT; generated by go run testdata/gen.go
     2  #
     3  #name: optional field unification
     4  #evalPartial
     5  -- in.cue --
     6  a: {foo?: string}
     7  b: {foo: "foo"}
     8  c: a & b
     9  d: a & {"foo"?: "bar"}
    10  
    11  g1:       1
    12  "g\(1)"?: 1
    13  "g\(2)"?: 2
    14  -- out/def --
    15  a: {
    16  	foo?: string
    17  }
    18  b: {
    19  	foo: "foo"
    20  }
    21  c: a & b
    22  d: a & {
    23  	foo?: "bar"
    24  }
    25  g1:  1
    26  g2?: 2
    27  -- out/export --
    28  a: {}
    29  b: {
    30  	foo: "foo"
    31  }
    32  c: {
    33  	foo: "foo"
    34  }
    35  d: {}
    36  g1: 1
    37  -- out/yaml --
    38  a: {}
    39  b:
    40    foo: foo
    41  c:
    42    foo: foo
    43  d: {}
    44  g1: 1
    45  -- out/json --
    46  {"a":{},"b":{"foo":"foo"},"c":{"foo":"foo"},"d":{},"g1":1}
    47  -- out/legacy-debug --
    48  <0>{a: <1>{foo?: string}, b: <2>{foo: "foo"}, c: <3>{foo: "foo"}, d: <4>{foo?: "bar"}, g1: 1, g2?: 2}
    49  -- out/compile --
    50  --- in.cue
    51  {
    52    a: {
    53      foo?: string
    54    }
    55    b: {
    56      foo: "foo"
    57    }
    58    c: (〈0;a〉 & 〈0;b〉)
    59    d: (〈0;a〉 & {
    60      foo?: "bar"
    61    })
    62    g1: 1
    63    "g\(1)"?: 1
    64    "g\(2)"?: 2
    65  }
    66  -- out/eval --
    67  (struct){
    68    a: (struct){
    69    }
    70    b: (struct){
    71      foo: (string){ "foo" }
    72    }
    73    c: (struct){
    74      foo: (string){ "foo" }
    75    }
    76    d: (struct){
    77    }
    78    g1: (int){ 1 }
    79    g2: (int){ 2 }
    80  }