fix: rename test module to tests

This commit is contained in:
rvcas
2022-12-23 21:53:59 -05:00
committed by Lucas
parent 01f2142606
commit 0d0536f6c1
33 changed files with 0 additions and 0 deletions

View 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]
}