Add new acceptance test scenario (012)
```
Error:
× Main thread panicked.
├─▶ at crates/lang/src/uplc.rs:3413:34
╰─▶ internal error: entered unreachable code: Var {
scope: [
0,
1,
3,
24,
25,
29,
32,
],
constructor: ValueConstructor {
public: false,
variant: LocalVariable {
location: 46..62,
},
tipo: Fn {
args: [
Var {
tipo: RefCell {
value: Link {
tipo: App {
public: true,
module: "",
name: "Int",
args: [],
},
},
},
},
],
ret: App {
public: true,
module: "",
name: "Bool",
args: [],
},
},
},
name: "f",
variant_name: "",
}
```
This commit is contained in:
2
examples/acceptance_tests/012/aiken.toml
Normal file
2
examples/acceptance_tests/012/aiken.toml
Normal file
@@ -0,0 +1,2 @@
|
||||
name = "acceptance_test_012"
|
||||
version = "0.0.0"
|
||||
18
examples/acceptance_tests/012/lib/test.ak
Normal file
18
examples/acceptance_tests/012/lib/test.ak
Normal file
@@ -0,0 +1,18 @@
|
||||
use aiken/builtin
|
||||
|
||||
pub fn filter(xs: List<a>, f: fn(a) -> Bool) -> List<a> {
|
||||
when xs is {
|
||||
[] -> []
|
||||
[x, ..rest] ->
|
||||
if f(x) {
|
||||
[x, ..filter(rest, f)]
|
||||
} else {
|
||||
filter(rest, f)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
test filter_1() {
|
||||
filter([1,
|
||||
2, 3, 4, 5, 6], fn(x) { builtin.mod_integer(x, 2) == 0 }) == [2, 4, 6]
|
||||
}
|
||||
Reference in New Issue
Block a user