-- in.cue --
i1: >1 & 5           @test(eq, 5)
i2: (>=0 & <=10) & 5 @test(eq, 5)
i3: !=null & []      @test(eq, [])
i4: !=2 & !=4        @test(eq, !=2 & !=4)

s1: >=0 & <=10 & !=1  @test(eq, >=0 & <=10 & !=1) // no simplification
s2: >=0 & <=10 & !=11 @test(eq, >=0 & <=10)
s3: >5 & !=5          @test(eq, >5)
s4: <10 & !=10        @test(eq, <10)
s5: !=2 & !=2         @test(eq, !=2)

// TODO: could change inequality
s6: !=2 & >=2 @test(eq, >=2 & !=2) @test(eq:todo, >2)
s7: >=2 & !=2 @test(eq, >=2 & !=2) @test(eq:todo, >2)

s8: !=5 & >5 @test(eq, >5)

s10: >=0 & <=10 & <12 & >1 @test(eq, >1 & <=10) // >1  & <=10
s11: >0 & >=0 & <=12 & <12 @test(eq, >0 & <12)  // >0  & <12

s20: >=10 & <=10 @test(eq, >=10 & <=10) @test(eq:todo, ==10)

s22:  >5 & <=6         @test(eq, >5 & <=6) // no simplification
s22a: >5 & (<=6 & int) @test(eq, >5 & <=6 & int) @test(eq:todo, ==6)
s22b: (int & >5) & <=6 @test(eq, >5 & <=6 & int) @test(eq:todo, ==6)
s22c: >=5 & (<6 & int) @test(eq, >=5 & <6 & int) @test(eq:todo, ==5)
s22d: (int & >=5) & <6 @test(eq, >=5 & <6 & int) @test(eq:todo, ==5)
s22e: (>=5 & <6) & int @test(eq, >=5 & <6 & int) @test(eq:todo, ==5)
s22f: int & (>=5 & <6) @test(eq, >=5 & <6 & int) @test(eq:todo, ==5)

s23:  >0 & <2         @test(eq, >0 & <2) // no simplification
s23a: (>0 & <2) & int @test(eq, >0 & <2 & int) @test(eq:todo, ==1)
s23b: int & (>0 & <2) @test(eq, >0 & <2 & int) @test(eq:todo, ==1)
s23c: (int & >0) & <2 @test(eq, >0 & <2 & int) @test(eq:todo, ==1)
s23d: >0 & (int & <2) @test(eq, >0 & <2 & int) @test(eq:todo, ==1)
s23e: >0.0 & <2.0     @test(eq, >0.0 & <2.0) // no simplification

s30: >0 & int @test(eq, >0 & int)

floats: {
	[string]: float
	f1:       <10.0 & <=5.0 @test(eq, <=5.0 & float)
	f2:       <=10.0 & <5.0 @test(eq, <5.0 & float)
	f3:       <1.1 & <=1.1  @test(eq, <1.1 & float)
	f4:       <=1.1 & <=1.1 @test(eq, <=1.1 & float)
	f5:       >1.1 & >=1.1  @test(eq, >1.1 & float)
	f6:       >=1.1 & >1.1  @test(eq, >1.1 & float)
	f7:       >=1.1 & <=1.1 @test(eq, >=1.1 & <=1.1 & float)

	issue1310: >=2.1 & <=1.0 @test(err, code=eval, contains="incompatible number bounds", pos=[0:21, 0:13])
	fe2:       >2.1 & <=2.1 @test(err, code=eval, contains="incompatible number bounds", pos=[0:20, 0:13])

	fe3: float & >2 & <=3 @test(eq, >2 & <=3 & float)
}

e1: null & !=null @test(err, code=eval, contains="conflicting values null and !=null", pos=[0:5, 0:12])
e2: !=null & null @test(err, code=eval, contains="conflicting values null and !=null", pos=[0:5, 0:14])
e3: >1 & 1     @test(err, code=eval, contains="invalid value 1", pos=[0:5, 0:10])
e4: <0 & 0     @test(err, code=eval, contains="invalid value 0", pos=[0:5, 0:10])
e5: >1 & <0    @test(err, code=eval, contains="incompatible number bounds", pos=[0:10, 0:5])
e6: >11 & <11  @test(err, code=eval, contains="incompatible number bounds", pos=[0:11, 0:5])
e7: >=11 & <11 @test(err, code=eval, contains="incompatible number bounds", pos=[0:12, 0:5])
e8: >11 & <=11 @test(err, code=eval, contains="incompatible number bounds", pos=[0:11, 0:5])
e9: >"a" & <1  @test(err, code=eval, contains="conflicting values", pos=[0:5, 0:12])
-- out/errors.txt --
[eval] floats.issue1310: incompatible number bounds <=1.0 and >=2.1:
    ./in.cue:50:21
    ./in.cue:50:13
[eval] floats.fe2: incompatible number bounds <=2.1 and >2.1:
    ./in.cue:51:20
    ./in.cue:51:13
[eval] e1: conflicting values null and !=null (mismatched types null and (bool|string|bytes|func|list|struct|number)):
    ./in.cue:56:5
    ./in.cue:56:12
[eval] e2: conflicting values null and !=null (mismatched types null and (bool|string|bytes|func|list|struct|number)):
    ./in.cue:57:5
    ./in.cue:57:14
[eval] e3: invalid value 1 (out of bound >1):
    ./in.cue:58:5
    ./in.cue:58:10
[eval] e4: invalid value 0 (out of bound <0):
    ./in.cue:59:5
    ./in.cue:59:10
[eval] e5: incompatible number bounds <0 and >1:
    ./in.cue:60:10
    ./in.cue:60:5
[eval] e6: incompatible number bounds <11 and >11:
    ./in.cue:61:11
    ./in.cue:61:5
[eval] e7: incompatible number bounds <11 and >=11:
    ./in.cue:62:12
    ./in.cue:62:5
[eval] e8: incompatible number bounds <=11 and >11:
    ./in.cue:63:11
    ./in.cue:63:5
[eval] e9: conflicting values >"a" and <1 (mismatched types string and number):
    ./in.cue:64:5
    ./in.cue:64:12
-- out/eval/stats --
Leaks:  0
Freed:  50
Reused: 0
Allocs: 50
Retain: 0

Unifications: 50
Conjuncts:    126
Disjuncts:    0
