Add more complex test 40.

Add assert for when constr index is given
This commit is contained in:
Kasey White
2023-01-30 04:17:03 -05:00
parent 8c04ab093a
commit a638388747
3 changed files with 87 additions and 7 deletions

View File

@@ -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 == #[]
}