added test case for KT-2374
This commit is contained in:
@@ -25,6 +25,10 @@ public final class ForeachTest extends AbstractExpressionTest {
|
||||
super("for/");
|
||||
}
|
||||
|
||||
public void TODO_testForUpTo() throws Exception {
|
||||
fooBoxIsValue(10);
|
||||
}
|
||||
|
||||
public void testForIteratesOverArray() throws Exception {
|
||||
fooBoxTest();
|
||||
}
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
package foo
|
||||
|
||||
fun box() : Int {
|
||||
var sum = 0
|
||||
for (i in 0.upto(5)) {
|
||||
sum += i
|
||||
}
|
||||
return sum
|
||||
}
|
||||
@@ -41,6 +41,10 @@ var kotlin = {set:function (receiver, key, value) {
|
||||
return answer;
|
||||
};
|
||||
|
||||
Kotlin.upto = function (from, limit, reversed) {
|
||||
return Kotlin.$new(Kotlin.NumberRange)(from, limit - from, reversed).iterator();
|
||||
};
|
||||
|
||||
Kotlin.modules = {};
|
||||
Kotlin.Exceptions = {};
|
||||
Kotlin.Exception = Kotlin.$createClass();
|
||||
|
||||
Reference in New Issue
Block a user