github.com/solo-io/cue@v0.4.7/cue/testdata/fulleval/011_field_comprehensions_with_templates.txtar (about)

     1  # DO NOT EDIT; generated by go run testdata/gen.go
     2  #
     3  #name: field comprehensions with templates
     4  #evalFull
     5  -- in.cue --
     6  num: 1
     7  a: {
     8  	if num < 5 {
     9  		[A=string]: [B=string]: {
    10  			name: A
    11  			kind: B
    12  		}
    13  	}
    14  }
    15  a: b: c: d: "bar"
    16  -- out/def --
    17  num: 1
    18  a: {
    19  	{[A=string]: {
    20  		[B=string]: {
    21  			name: A, kind: B
    22  		}
    23  	}}
    24  	b: {
    25  		{[B=string]: {
    26  			name: "b", kind: B
    27  		}}
    28  		c: {
    29  			name: "b"
    30  			kind: "c"
    31  			d:    "bar"
    32  		}
    33  	}
    34  }
    35  -- out/export --
    36  num: 1
    37  a: {
    38  	b: {
    39  		c: {
    40  			name: "b"
    41  			kind: "c"
    42  			d:    "bar"
    43  		}
    44  	}
    45  }
    46  -- out/yaml --
    47  num: 1
    48  a:
    49    b:
    50      c:
    51        name: b
    52        kind: c
    53        d: bar
    54  -- out/json --
    55  {"num":1,"a":{"b":{"c":{"name":"b","kind":"c","d":"bar"}}}}
    56  -- out/legacy-debug --
    57  <0>{num: 1, a: <1>{[]: <2>(A: string)-><3>{[]: <4>(B: string)-><5>{name: <2>.A, kind: <4>.B}, }, b: <6>{[]: <7>(B: string)-><8>{name: <9>.A, kind: <7>.B}, c: <10>{name: "b", kind: "c", d: "bar"}}}}
    58  -- out/compile --
    59  --- in.cue
    60  {
    61    num: 1
    62    a: {
    63      if (〈1;num〉 < 5) {
    64        [string]: {
    65          [string]: {
    66            name: 〈2;-〉
    67            kind: 〈1;-〉
    68          }
    69        }
    70      }
    71    }
    72    a: {
    73      b: {
    74        c: {
    75          d: "bar"
    76        }
    77      }
    78    }
    79  }
    80  -- out/eval --
    81  (struct){
    82    num: (int){ 1 }
    83    a: (struct){
    84      b: (struct){
    85        c: (struct){
    86          d: (string){ "bar" }
    87          name: (string){ "b" }
    88          kind: (string){ "c" }
    89        }
    90      }
    91    }
    92  }