rename examples/tests/{a,b,c,d,e,f} into examples/acceptance_tests/00{1,2,3,4,5,6}
Also added a little Makefile to run them all in one go.
This commit is contained in:
2
examples/acceptance_tests/003/aiken.toml
Normal file
2
examples/acceptance_tests/003/aiken.toml
Normal file
@@ -0,0 +1,2 @@
|
||||
name = "acceptance_test_003"
|
||||
version = "0.0.0"
|
||||
14
examples/acceptance_tests/003/lib/test.ak
Normal file
14
examples/acceptance_tests/003/lib/test.ak
Normal file
@@ -0,0 +1,14 @@
|
||||
pub fn foldr(xs: List<a>, f: fn(a, b) -> b, zero: b) -> b {
|
||||
when xs is {
|
||||
[] -> zero
|
||||
[x, ..rest] -> f(x, foldr(rest, f, zero))
|
||||
}
|
||||
}
|
||||
|
||||
pub fn concat(left: List<a>, right: List<a>) -> List<a> {
|
||||
foldr(left, fn(x, xs) { [x, ..xs] }, right)
|
||||
}
|
||||
|
||||
test concat_1() {
|
||||
concat([1, 2, 3], [4, 5, 6]) == [1, 2, 3, 4, 5, 6]
|
||||
}
|
||||
Reference in New Issue
Block a user