github.com/solo-io/cue@v0.4.7/cue/testdata/interpolation/041_interpolation.txtar (about)

     1  # DO NOT EDIT; generated by go run testdata/gen.go
     2  #
     3  #name: interpolation
     4  #evalPartial
     5  -- in.cue --
     6  a: "\(4)"
     7  b: "one \(a) two \( a+c )"
     8  c: "one"
     9  d: "\(r)"
    10  u: "\(_)"
    11  r: _
    12  e: "\([])"
    13  -- out/def --
    14  a: "4"
    15  b: "one 4 two 4one"
    16  c: "one"
    17  d: "\(r)"
    18  r: _
    19  u: "\(_)"
    20  e: _|_ // expression in interpolation must evaluate to a number kind or string (found list)
    21  -- out/legacy-debug --
    22  <0>{a: "4", b: "one 4 two 4one", c: "one", d: ""+<1>.r+"", r: _, u: ""+_+"", e: _|_([]:expression in interpolation must evaluate to a number kind or string (found list))}
    23  -- out/compile --
    24  --- in.cue
    25  {
    26    a: "\(4)"
    27    b: "one \(〈0;a〉) two \((〈0;a〉 + 〈0;c〉))"
    28    c: "one"
    29    d: "\(〈0;r〉)"
    30    u: "\(_)"
    31    r: _
    32    e: "\([])"
    33  }
    34  -- out/eval --
    35  Errors:
    36  e: invalid interpolation: cannot use [] (type list) as type (bool|string|bytes|number):
    37      ./in.cue:7:4
    38      ./in.cue:7:7
    39  
    40  Result:
    41  (_|_){
    42    // [eval]
    43    a: (string){ "4" }
    44    b: (string){ "one 4 two 4one" }
    45    c: (string){ "one" }
    46    d: (_|_){
    47      // [incomplete] d: invalid interpolation: non-concrete value _ (type _):
    48      //     ./in.cue:4:4
    49    }
    50    u: (_|_){
    51      // [incomplete] u: invalid interpolation: non-concrete value _ (type _):
    52      //     ./in.cue:5:4
    53      //     ./in.cue:5:7
    54    }
    55    r: (_){ _ }
    56    e: (_|_){
    57      // [eval] e: invalid interpolation: cannot use [] (type list) as type (bool|string|bytes|number):
    58      //     ./in.cue:7:4
    59      //     ./in.cue:7:7
    60    }
    61  }