fix: acceptance test 040 after new casting rules

This commit is contained in:
rvcas 2023-02-02 01:17:58 -05:00
parent ae42dc964a
commit 0f6d2487ec
No known key found for this signature in database
GPG Key ID: C09B64E263F7D68C
1 changed files with 19 additions and 15 deletions

View File

@ -1,8 +1,9 @@
pub type Door{ use aiken/builtin
angle: Int,
locked: Bool
}
pub type Door {
angle: Int,
locked: Bool,
}
pub type Car { pub type Car {
Honda { remote_connect: ByteArray, owner: ByteArray, wheels: Int } Honda { remote_connect: ByteArray, owner: ByteArray, wheels: Int }
@ -11,19 +12,22 @@ pub type Car {
owner: ByteArray, owner: ByteArray,
wheels: Int, wheels: Int,
truck_bed_limit: Int, truck_bed_limit: Int,
car_doors: List<Door> car_doors: List<Door>,
} }
} }
// test update_owner2_should_fail(){
// 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() { test update_owner1() {
let initial_car: Data = let initial_car =
Ford { remote_connect: #[], owner: #[], wheels: 4, truck_bed_limit: 10000, car_doors: [] } builtin.constr_data(
assert Ford { owner, .. }: Car = initial_car 1,
owner == #[] [
builtin.b_data(#""),
builtin.b_data(#""),
builtin.i_data(4),
builtin.i_data(10000),
builtin.list_data([]),
],
)
assert Ford { owner, wheels, truck_bed_limit, .. }: Car = initial_car
owner == #"" && wheels == 4 && truck_bed_limit == 10000
} }