# let dollar-dollar tests

FEATURE: let dollar-dollar 
background:
thenType: struct

---
title: simple
given:
 type Customer struct {id int unique, relation addr Address optional many } end
 type Address struct {id int unique, relation cust Customer optional one } end

  insert Customer {id: 55 }
  insert Customer {id: 56 }
when:
  let x = Customer[true].id.max()
  let y = $$
then:
value:a:int:56

---
title: full obj
given:
 type Customer struct {id int unique, relation addr Address optional many } end
 type Address struct {id int unique, relation cust Customer optional one } end

  insert Customer {id: 55 }
  insert Customer {id: 56 }
when:
  let x = Customer[true]
  let y = $$
then:
value:a:Customer {
 vid:55
 vaddr:null
}
value:a:Customer {
 vid:56
 vaddr:null
}

