cuelang.org/go@v0.10.1/cue/testdata/basicrewrite/016_comparison.txtar (about)

     1  # DO NOT EDIT; generated by go run testdata/gen.go
     2  #
     3  #name: comparison
     4  #evalPartial
     5  -- in.cue --
     6  lss: 1 < 2
     7  leq: 1 <= 1.0
     8  leq: 2.0 <= 3
     9  eql: 1 == 1.0
    10  neq: 1.0 == 1
    11  gtr: !(2 > 3)
    12  geq: 2.0 >= 2
    13  seq: "a"+"b" == "ab"
    14  err: 2 == "s"
    15  -- out/def --
    16  lss: true
    17  leq: true
    18  eql: true
    19  neq: true
    20  gtr: true
    21  geq: true
    22  seq: true
    23  err: _|_ // invalid operation 2 == "s" (mismatched types int and string)
    24  -- out/legacy-debug --
    25  <0>{lss: true, leq: true, eql: true, neq: true, gtr: true, geq: true, seq: true, err: _|_((2 == "s"):invalid operation 2 == "s" (mismatched types int and string))}
    26  -- out/compile --
    27  --- in.cue
    28  {
    29    lss: (1 < 2)
    30    leq: (1 <= 1.0)
    31    leq: (2.0 <= 3)
    32    eql: (1 == 1.0)
    33    neq: (1.0 == 1)
    34    gtr: !(2 > 3)
    35    geq: (2.0 >= 2)
    36    seq: (("a" + "b") == "ab")
    37    err: (2 == "s")
    38  }
    39  -- out/eval/stats --
    40  Leaks:  0
    41  Freed:  9
    42  Reused: 7
    43  Allocs: 2
    44  Retain: 0
    45  
    46  Unifications: 9
    47  Conjuncts:    10
    48  Disjuncts:    9
    49  -- out/eval --
    50  Errors:
    51  err: invalid operands 2 and "s" to '==' (type int and string):
    52      ./in.cue:9:6
    53      ./in.cue:9:11
    54  
    55  Result:
    56  (_|_){
    57    // [eval]
    58    lss: (bool){ true }
    59    leq: (bool){ true }
    60    eql: (bool){ true }
    61    neq: (bool){ true }
    62    gtr: (bool){ true }
    63    geq: (bool){ true }
    64    seq: (bool){ true }
    65    err: (_|_){
    66      // [eval] err: invalid operands 2 and "s" to '==' (type int and string):
    67      //     ./in.cue:9:6
    68      //     ./in.cue:9:11
    69    }
    70  }