Add new acceptance test scenario (013)
``` ERROR: The provided Plutus code called 'error' ```
This commit is contained in:
2
examples/acceptance_tests/013/aiken.toml
Normal file
2
examples/acceptance_tests/013/aiken.toml
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
name = "acceptance_test_013"
|
||||||
|
version = "0.0.0"
|
||||||
13
examples/acceptance_tests/013/lib/test.ak
Normal file
13
examples/acceptance_tests/013/lib/test.ak
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
pub fn unzip(xs: List<#(a, b)>) -> #(List<a>, List<b>) {
|
||||||
|
when xs is {
|
||||||
|
[] -> #([], [])
|
||||||
|
[#(a, b), ..rest] -> {
|
||||||
|
let #(a_tail, b_tail) = unzip(rest)
|
||||||
|
#([a, ..a_tail], [b, ..b_tail])
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
test unzip_1() {
|
||||||
|
unzip([#(1, "a"), #(2, "b")]) == #([1, 2], ["a", "b"])
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user