...

Text file src/cuelang.org/go/cue/testdata/resolve/018_slice.txtar

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

     1# DO NOT EDIT; generated by go run testdata/gen.go
     2#
     3#name: slice
     4#evalPartial
     5-- in.cue --
     6a:  [2][0:0]
     7b:  [0][1:1]
     8e1: [][1:1]
     9e2: [0][-1:0]
    10e3: [0][1:0]
    11e4: [0][1:2]
    12e5: 4[1:2]
    13e6: [2]["":]
    14e7: [2][:"9"]
    15-- out/def --
    16a: []
    17b: []
    18e1: _|_ // slice bounds out of range
    19e2: _|_ // negative slice index
    20e3: _|_ // invalid slice index: 1 > 0
    21e4: _|_ // slice bounds out of range
    22e5: _|_ // cannot slice 4 (type int)
    23e6: _|_ // invalid slice index "" (type string)
    24e7: _|_ // invalid slice index "9" (type string)
    25-- out/legacy-debug --
    26<0>{a: [], b: [], e1: _|_(1:slice bounds out of range), e2: _|_([0]:negative slice index), e3: _|_([0]:invalid slice index: 1 > 0), e4: _|_(2:slice bounds out of range), e5: _|_(4:cannot slice 4 (type int)), e6: _|_("":invalid slice index "" (type string)), e7: _|_("9":invalid slice index "9" (type string))}
    27-- out/compile --
    28--- in.cue
    29{
    30  a: [
    31    2,
    32  ][0:0]
    33  b: [
    34    0,
    35  ][1:1]
    36  e1: [][1:1]
    37  e2: [
    38    0,
    39  ][-1:0]
    40  e3: [
    41    0,
    42  ][1:0]
    43  e4: [
    44    0,
    45  ][1:2]
    46  e5: 4[1:2]
    47  e6: [
    48    2,
    49  ]["":]
    50  e7: [
    51    2,
    52  ][:"9"]
    53}
    54-- out/eval/stats --
    55Leaks:  8
    56Freed:  10
    57Reused: 8
    58Allocs: 10
    59Retain: 8
    60
    61Unifications: 18
    62Conjuncts:    18
    63Disjuncts:    18
    64-- out/eval --
    65Errors:
    66e1: index 1 out of range:
    67    ./in.cue:3:5
    68e2: cannot convert negative number to uint64:
    69    ./in.cue:4:5
    70e3: invalid slice index: 1 > 0:
    71    ./in.cue:5:5
    72e4: index 2 out of range:
    73    ./in.cue:6:5
    74e5: cannot slice 4 (type int):
    75    ./in.cue:7:5
    76e6: cannot use "" (type string) as type int in slice index:
    77    ./in.cue:8:5
    78    ./in.cue:8:9
    79e7: cannot use "9" (type string) as type int in slice index:
    80    ./in.cue:9:5
    81    ./in.cue:9:10
    82
    83Result:
    84(_|_){
    85  // [eval]
    86  a: (#list){
    87  }
    88  b: (#list){
    89  }
    90  e1: (_|_){
    91    // [eval] e1: index 1 out of range:
    92    //     ./in.cue:3:5
    93  }
    94  e2: (_|_){
    95    // [eval] e2: cannot convert negative number to uint64:
    96    //     ./in.cue:4:5
    97  }
    98  e3: (_|_){
    99    // [eval] e3: invalid slice index: 1 > 0:
   100    //     ./in.cue:5:5
   101  }
   102  e4: (_|_){
   103    // [eval] e4: index 2 out of range:
   104    //     ./in.cue:6:5
   105  }
   106  e5: (_|_){
   107    // [eval] e5: cannot slice 4 (type int):
   108    //     ./in.cue:7:5
   109  }
   110  e6: (_|_){
   111    // [eval] e6: cannot use "" (type string) as type int in slice index:
   112    //     ./in.cue:8:5
   113    //     ./in.cue:8:9
   114  }
   115  e7: (_|_){
   116    // [eval] e7: cannot use "9" (type string) as type int in slice index:
   117    //     ./in.cue:9:5
   118    //     ./in.cue:9:10
   119  }
   120}

View as plain text