Updated test data and stdlib sources.

This commit is contained in:
Evgeny Gerashchenko
2013-02-12 02:19:55 +04:00
parent 105d2d72de
commit b9e5704057
43 changed files with 96 additions and 78 deletions
@@ -8,7 +8,7 @@ fun box() : Boolean {
a1[3] = 3
a1[5] = 5
for (var a : Int? in a1) {
for (a : Int? in a1) {
if (a != null) {
c += 1;
} else {
@@ -2,12 +2,13 @@ package foo
var b = 0
fun loop(var times: Int) {
while (times > 0) {
fun loop(times: Int) {
var left = times
while (left > 0) {
val u = {(value: Int) ->
b = b + 1
}
u(times--)
u(left--)
}
}
@@ -2,12 +2,13 @@ package foo
var c = 2
fun loop(var times : Int) {
while(times > 0) {
fun loop(times : Int) {
var left = times
while(left > 0) {
val u : (value : Int) -> Unit = {
c++
}
u(times--)
u(left--)
}
}
@@ -4,7 +4,7 @@ import java.util.*
fun <T> ArrayList<T>.findAll(predicate: (T) -> Boolean): ArrayList<T> {
val result = ArrayList<T>()
for(val t in this) {
for(t in this) {
if (predicate(t)) result.add(t)
}
return result
@@ -495,6 +495,6 @@ class Vector(val x: Double = 0.0, val y: Double = 0.0) {
get() = this * (1.0 / Math.sqrt(sqr))
}
fun getRandomArbitary(val min: Int, val max: Int): Double {
fun getRandomArbitary(min: Int, max: Int): Double {
return Math.random() * (max - min) + min;
}