Add more complex test 40.
Add assert for when constr index is given
This commit is contained in:
@@ -1,3 +1,9 @@
|
||||
pub type Door{
|
||||
angle: Int,
|
||||
locked: Bool
|
||||
}
|
||||
|
||||
|
||||
pub type Car {
|
||||
Honda { remote_connect: ByteArray, owner: ByteArray, wheels: Int }
|
||||
Ford {
|
||||
@@ -5,18 +11,19 @@ pub type Car {
|
||||
owner: ByteArray,
|
||||
wheels: Int,
|
||||
truck_bed_limit: Int,
|
||||
car_doors: List<Door>
|
||||
}
|
||||
}
|
||||
|
||||
// test update_owner2_should_fail(){
|
||||
// let initial_car: Data = Ford{remote_connect: #[], owner: #[], wheels: 4, truck_bed_limit: 10000}
|
||||
// let initial_car: Data = Ford{remote_connect: #[], owner: #[], wheels: 4, truck_bed_limit: 10000, car_doors: []}
|
||||
// assert Honda{ owner, ..}: Car = initial_car
|
||||
// owner == #[]
|
||||
// }
|
||||
|
||||
test update_owner1() {
|
||||
let initial_car: Data =
|
||||
Ford { remote_connect: #[], owner: #[], wheels: 4, truck_bed_limit: 10000 }
|
||||
Ford { remote_connect: #[], owner: #[], wheels: 4, truck_bed_limit: 10000, car_doors: [] }
|
||||
assert Ford { owner, .. }: Car = initial_car
|
||||
owner == #[]
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user