github.com/solo-io/cue@v0.4.7/cue/testdata/resolve/027_new-style_definitions.txtar (about)

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