github.com/solo-io/cue@v0.4.7/cue/testdata/resolve/012_bound_conversions.txtar (about)

     1  # DO NOT EDIT; generated by go run testdata/gen.go
     2  #
     3  #name: bound conversions
     4  #evalPartial
     5  -- in.cue --
     6  r0: int & >0.1 & <=1.9
     7  r1: int & >0.1 & <1.9
     8  r2: int & >=0.1 & <1.9
     9  r3: int & >=-1.9 & <=-0.1
    10  r4: int & >-1.9 & <=-0.1
    11  
    12  r5: >=1.1 & <=1.1
    13  r6: r5 & 1.1
    14  
    15  c1: (1.2 & >1.3) & <2
    16  c2: 1.2 & (>1.3 & <2)
    17  
    18  c3: 1.2 & (>=1 & <2)
    19  c4: 1.2 & (>=1 & <2 & int)
    20  -- out/def --
    21  r0: 1
    22  r1: 1
    23  r2: 1
    24  r3: -1
    25  r4: -1
    26  r5: 1.1
    27  r6: 1.1
    28  c1: _|_ // invalid value 1.2 (out of bound >1.3)
    29  c2: _|_ // invalid value 1.2 (out of bound >1.3)
    30  c3: 1.2
    31  c4: _|_ // conflicting values 1.2 and ((>=1 & <2) & int) (mismatched types float and int)
    32  -- out/legacy-debug --
    33  <0>{r0: 1, r1: 1, r2: 1, r3: -1, r4: -1, r5: 1.1, r6: 1.1, c1: _|_((>1.3 & 1.2):invalid value 1.2 (out of bound >1.3)), c2: _|_((>1.3 & 1.2):invalid value 1.2 (out of bound >1.3)), c3: 1.2, c4: _|_((1.2 & ((>=1 & <2) & int)):conflicting values 1.2 and ((>=1 & <2) & int) (mismatched types float and int))}
    34  -- out/compile --
    35  --- in.cue
    36  {
    37    r0: ((int & >0.1) & <=1.9)
    38    r1: ((int & >0.1) & <1.9)
    39    r2: ((int & >=0.1) & <1.9)
    40    r3: ((int & >=-1.9) & <=-0.1)
    41    r4: ((int & >-1.9) & <=-0.1)
    42    r5: (>=1.1 & <=1.1)
    43    r6: (〈0;r5〉 & 1.1)
    44    c1: ((1.2 & >1.3) & <2)
    45    c2: (1.2 & (>1.3 & <2))
    46    c3: (1.2 & (>=1 & <2))
    47    c4: (1.2 & ((>=1 & <2) & int))
    48  }
    49  -- out/eval --
    50  Errors:
    51  c4: conflicting values 1.2 and int (mismatched types float and int):
    52      ./in.cue:14:5
    53      ./in.cue:14:23
    54  c1: invalid value 1.2 (out of bound >1.3):
    55      ./in.cue:10:12
    56      ./in.cue:10:6
    57  c2: invalid value 1.2 (out of bound >1.3):
    58      ./in.cue:11:12
    59      ./in.cue:11:5
    60  
    61  Result:
    62  (_|_){
    63    // [eval]
    64    r0: (int){ 1 }
    65    r1: (int){ 1 }
    66    r2: (int){ 1 }
    67    r3: (int){ -1 }
    68    r4: (int){ -1 }
    69    r5: (number){ 1.1 }
    70    r6: (number){ 1.1 }
    71    c1: (_|_){
    72      // [eval] c1: invalid value 1.2 (out of bound >1.3):
    73      //     ./in.cue:10:12
    74      //     ./in.cue:10:6
    75    }
    76    c2: (_|_){
    77      // [eval] c2: invalid value 1.2 (out of bound >1.3):
    78      //     ./in.cue:11:12
    79      //     ./in.cue:11:5
    80    }
    81    c3: (float){ 1.2 }
    82    c4: (_|_){
    83      // [eval] c4: conflicting values 1.2 and int (mismatched types float and int):
    84      //     ./in.cue:14:5
    85      //     ./in.cue:14:23
    86    }
    87  }