# rule tests

FEATURE: rules-inheritance
background:
 type Flight struct {id int unique, wid int optional }  end
 type Flight2 Flight {} wid < 10  end
thenType: struct

---
title: pass
given:
  insert Flight2 {id: 55, wid: 1 }
when:
  let x = Flight2[55]
then:
value:a:Flight2 {
 vid:55
 vwid:1
}

---
title: fail
given:
  insert Flight2 {id: 55, wid: 10 }
when:
  let x = Flight2[55];ERROR: rule-compare


---
title: optional-null
given:
  insert Flight2 {id: 55 }
when:
  let x = Flight2[55]
then:
value:a:Flight2 {
 vid:55
 vwid:null
}
---
title: Flight2-null2
given:
  insert Flight2 {id: 55, wid: null }
when:
  let x = Flight2[55]
then:
value:a:Flight2 {
 vid:55
 vwid:null
}


  