Rename directory for back-end tests

This commit is contained in:
Andrey Breslav
2013-11-26 20:34:10 +04:00
parent fe00b03279
commit c70a54306f
25 changed files with 54 additions and 54 deletions
@@ -0,0 +1,11 @@
tailRecursive fun <T, A> Iterator<T>.foldl(acc : A, foldFunction : (e : T, acc : A) -> A) : A =
if (!hasNext()) acc
else foldl(foldFunction(next(), acc), foldFunction)
fun box() : String {
val sum = (1..1000000).iterator().foldl(0) { (e : Int, acc : Long) ->
acc + e
}
return if (sum == 500000500000) "OK" else "FAIL: $sum"
}