added test case for KT-2374

This commit is contained in:
James Strachan
2012-07-06 08:34:35 +01:00
parent 33ef414f01
commit 96a7128a36
3 changed files with 17 additions and 0 deletions
@@ -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
}
+4
View File
@@ -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();