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:
@@ -1,15 +1,13 @@
|
||||
use other.{FFF, GGG}
|
||||
|
||||
test thing1() {
|
||||
let x =
|
||||
other.FFF
|
||||
let x = other.FFF
|
||||
|
||||
x == FFF
|
||||
}
|
||||
|
||||
test thing2() {
|
||||
let x =
|
||||
other.GGG(2)
|
||||
let x = other.GGG(2)
|
||||
|
||||
x == GGG(2)
|
||||
}
|
||||
|
||||
13
examples/acceptance_tests/084/aiken.lock
Normal file
13
examples/acceptance_tests/084/aiken.lock
Normal file
@@ -0,0 +1,13 @@
|
||||
# This file was generated by Aiken
|
||||
# You typically do not need to edit this file
|
||||
|
||||
[[requirements]]
|
||||
name = "aiken-lang/stdlib"
|
||||
version = "main"
|
||||
source = "github"
|
||||
|
||||
[[packages]]
|
||||
name = "aiken-lang/stdlib"
|
||||
version = "main"
|
||||
requirements = []
|
||||
source = "github"
|
||||
8
examples/acceptance_tests/084/aiken.toml
Normal file
8
examples/acceptance_tests/084/aiken.toml
Normal file
@@ -0,0 +1,8 @@
|
||||
name = "aiken-lang/acceptance_test_083"
|
||||
version = "0.0.0"
|
||||
description = ""
|
||||
|
||||
[[dependencies]]
|
||||
name = 'aiken-lang/stdlib'
|
||||
version = 'main'
|
||||
source = 'github'
|
||||
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