...

Text file src/cuelang.org/go/cue/testdata/resolve/009_optional_field_unification.txtar

Documentation: cuelang.org/go/cue/testdata/resolve

     1# DO NOT EDIT; generated by go run testdata/gen.go
     2#
     3#name: optional field unification
     4#evalPartial
     5-- in.cue --
     6a: {foo?: string}
     7b: {foo: "foo"}
     8c: a & b
     9d: a & {"foo"?: "bar"}
    10
    11g1:       1
    12"g\(1)"?: 1
    13"g\(2)"?: 2
    14-- out/def --
    15a: {
    16	foo?: string
    17}
    18b: {
    19	foo: "foo"
    20}
    21c: a & b
    22d: a & {
    23	foo?: "bar"
    24}
    25g1:  1
    26g2?: 2
    27-- out/export --
    28a: {}
    29b: {
    30	foo: "foo"
    31}
    32c: {
    33	foo: "foo"
    34}
    35d: {}
    36g1: 1
    37-- out/yaml --
    38a: {}
    39b:
    40  foo: foo
    41c:
    42  foo: foo
    43d: {}
    44g1: 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/stats --
    67Leaks:  0
    68Freed:  11
    69Reused: 8
    70Allocs: 3
    71Retain: 0
    72
    73Unifications: 11
    74Conjuncts:    19
    75Disjuncts:    11
    76-- out/eval --
    77(struct){
    78  a: (struct){
    79    foo?: (string){ string }
    80  }
    81  b: (struct){
    82    foo: (string){ "foo" }
    83  }
    84  c: (struct){
    85    foo: (string){ "foo" }
    86  }
    87  d: (struct){
    88    foo?: (string){ "bar" }
    89  }
    90  g1: (int){ 1 }
    91  g2?: (int){ 2 }
    92}

View as plain text