github.com/solo-io/cue@v0.4.7/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 -- 40 Errors: 41 err: invalid operands 2 and "s" to '==' (type int and string): 42 ./in.cue:9:6 43 ./in.cue:9:11 44 45 Result: 46 (_|_){ 47 // [eval] 48 lss: (bool){ true } 49 leq: (bool){ true } 50 eql: (bool){ true } 51 neq: (bool){ true } 52 gtr: (bool){ true } 53 geq: (bool){ true } 54 seq: (bool){ true } 55 err: (_|_){ 56 // [eval] err: invalid operands 2 and "s" to '==' (type int and string): 57 // ./in.cue:9:6 58 // ./in.cue:9:11 59 } 60 }