# let query filter tests

FEATURE: filter-expr op long
background:
  type Flight struct {id long unique, wid long optional }  end
thenType: struct

---
title: < 
given:
  insert Flight {id: 55, wid: 1 }
when:
  let x = Flight[wid < 10]
then:
value:a:Flight {
 vid:55
 vwid:1
}
---
title: < none
given:
  insert Flight {id: 55, wid: 1 }
when:
  let x = Flight[wid < 1]
then:
null

---
title: <= 
given:
  insert Flight {id: 55, wid: 1 }
when:
  let x = Flight[wid <= 1]
then:
value:a:Flight {
 vid:55
 vwid:1
}
---
title: <= none
given:
  insert Flight {id: 55, wid: 1 }
when:
  let x = Flight[wid <= 0]
then:
null

---
title: > 
given:
  insert Flight {id: 55, wid: 1 }
when:
  let x = Flight[wid > 0]
then:
value:a:Flight {
 vid:55
 vwid:1
}
---
title: > fail
given:
  insert Flight {id: 55, wid: 1 }
when:
  let x = Flight[wid > 1]
then:
null

---
title: >= 
given:
  insert Flight {id: 55, wid: 1 }
when:
  let x = Flight[wid >= 0]
then:
value:a:Flight {
 vid:55
 vwid:1
}
---
title: >= fail
given:
  insert Flight {id: 55, wid: 1 }
when:
  let x = Flight[wid >= 2]
then:
null

---
title: == 
given:
  insert Flight {id: 55, wid: 1 }
when:
  let x = Flight[wid == 1]
then:
value:a:Flight {
 vid:55
 vwid:1
}
---
title: == fail
given:
  insert Flight {id: 55, wid: 1 }
when:
  let x = Flight[wid == 2]
then:
null

---
title: != 
given:
  insert Flight {id: 55, wid: 1 }
when:
  let x = Flight[wid != 11]
then:
value:a:Flight {
 vid:55
 vwid:1
}
---
title: != fail
given:
  insert Flight {id: 55, wid: 1 }
when:
  let x = Flight[wid != 1]
then:
null

---
title: reverse args. TODO:fix
given:
  insert Flight {id: 55, wid: 1 }
when:
  let x = Flight[1 == wid]
then:
value:a:Flight {
 vid:55
 vwid:1
}
