...

Text file src/cuelang.org/go/cue/testdata/resolve/027_new-style_definitions.txtar

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

     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
    12bulk: {[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}
    25bulk: {
    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}
    36bulk: {
    37	a: "foo"
    38}
    39-- out/yaml --
    40'#Foo':
    41  a: 1
    42  b: 1
    43bulk:
    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/stats --
    68Leaks:  0
    69Freed:  11
    70Reused: 8
    71Allocs: 3
    72Retain: 0
    73
    74Unifications: 11
    75Conjuncts:    16
    76Disjuncts:    11
    77-- out/evalalpha --
    78(struct){
    79  #Foo: (#struct){
    80    a: (int){ 1 }
    81    b: (int){ int }
    82  }
    83  "#Foo": (#struct){
    84    b: (int){ 1 }
    85    a: (int){ 1 }
    86  }
    87  bulk: (struct){
    88    #def: (int){ 4 }
    89    _hid: (int){ 3 }
    90    a: (string){ "foo" }
    91  }
    92}
    93-- diff/-out/evalalpha<==>+out/eval --
    94diff old new
    95--- old
    96+++ new
    97@@ -4,8 +4,8 @@
    98     b: (int){ int }
    99   }
   100   "#Foo": (#struct){
   101-    a: (int){ 1 }
   102     b: (int){ 1 }
   103+    a: (int){ 1 }
   104   }
   105   bulk: (struct){
   106     #def: (int){ 4 }
   107-- diff/todo/p3 --
   108Reordering
   109-- out/eval --
   110(struct){
   111  #Foo: (#struct){
   112    a: (int){ 1 }
   113    b: (int){ int }
   114  }
   115  "#Foo": (#struct){
   116    a: (int){ 1 }
   117    b: (int){ 1 }
   118  }
   119  bulk: (struct){
   120    #def: (int){ 4 }
   121    _hid: (int){ 3 }
   122    a: (string){ "foo" }
   123  }
   124}

View as plain text