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

     1  # DO NOT EDIT; generated by go run testdata/gen.go
     2  #
     3  #evalFull
     4  -- in.cue --
     5  #Task: {
     6  	{
     7  		op:          "pull"
     8  		tag:         *"latest" | string
     9  		refToTag:    tag
    10  		tagExpr:     tag + "dd"
    11  		tagInString: "\(tag)"
    12  	} | {
    13  		op: "scratch"
    14  	}
    15  }
    16  
    17  foo: #Task & {"op": "pull"}
    18  -- out/def --
    19  #Task: {
    20  	op:          "pull"
    21  	tag:         *"latest" | string
    22  	refToTag:    tag
    23  	tagExpr:     "latestdd"
    24  	tagInString: "latest"
    25  } | {
    26  	op: "scratch"
    27  }
    28  foo: #Task & {
    29  	op: "pull"
    30  }
    31  -- out/export --
    32  foo: {
    33  	op:          "pull"
    34  	tag:         "latest"
    35  	refToTag:    "latest"
    36  	tagExpr:     "latestdd"
    37  	tagInString: "latest"
    38  }
    39  -- out/yaml --
    40  foo:
    41    op: pull
    42    tag: latest
    43    refToTag: latest
    44    tagExpr: latestdd
    45    tagInString: latest
    46  -- out/json --
    47  {"foo":{"op":"pull","tag":"latest","refToTag":"latest","tagExpr":"latestdd","tagInString":"latest"}}
    48  -- out/legacy-debug --
    49  <0>{#Task: (<1>C{op: "pull", tag: (*"latest" | string), refToTag: <1>.tag, tagExpr: (<1>.tag + "dd"), tagInString: ""+<1>.tag+""} | <2>C{op: "scratch"}), foo: <3>C{op: "pull", tag: "latest", refToTag: "latest", tagExpr: "latestdd", tagInString: "latest"}}
    50  -- out/compile --
    51  --- in.cue
    52  {
    53    #Task: {
    54      ({
    55        op: "pull"
    56        tag: (*"latest"|string)
    57        refToTag: 〈0;tag〉
    58        tagExpr: (〈0;tag〉 + "dd")
    59        tagInString: "\(〈0;tag〉)"
    60      }|{
    61        op: "scratch"
    62      })
    63    }
    64    foo: (〈0;#Task〉 & {
    65      op: "pull"
    66    })
    67  }
    68  -- out/eval --
    69  (struct){
    70    #Task: (#struct){ |((#struct){
    71        op: (string){ "pull" }
    72        tag: (string){ |(*(string){ "latest" }, (string){ string }) }
    73        refToTag: (string){ |(*(string){ "latest" }, (string){ string }) }
    74        tagExpr: (string){ "latestdd" }
    75        tagInString: (string){ "latest" }
    76      }, (#struct){
    77        op: (string){ "scratch" }
    78      }) }
    79    foo: (#struct){
    80      op: (string){ "pull" }
    81      tag: (string){ |(*(string){ "latest" }, (string){ string }) }
    82      refToTag: (string){ |(*(string){ "latest" }, (string){ string }) }
    83      tagExpr: (string){ "latestdd" }
    84      tagInString: (string){ "latest" }
    85    }
    86  }