fix: issue with tuple clause
It was not consuming the next case if there was no condition being checked in the clause. Now it properly always consumes the next clause unless last clause.
This commit is contained in:
22
examples/acceptance_tests/084/lib/tests.ak
Normal file
22
examples/acceptance_tests/084/lib/tests.ak
Normal file
@@ -0,0 +1,22 @@
|
||||
use aiken/list
|
||||
|
||||
test tuple_when() {
|
||||
let items =
|
||||
[(#"", #"", 50), (#"aa", #"bb", 70)]
|
||||
|
||||
let amount = 70
|
||||
let policy = #"aa"
|
||||
|
||||
let filtered =
|
||||
list.filter(
|
||||
items,
|
||||
fn(item) {
|
||||
when item is {
|
||||
(token_policy, _, token_amount) ->
|
||||
amount == token_amount && policy == token_policy
|
||||
_ -> False
|
||||
}
|
||||
},
|
||||
)
|
||||
list.length(filtered) > 0
|
||||
}
|
||||
Reference in New Issue
Block a user