Add tests for newly discovered issue with ECMA5 and top level vars in root scope.

This commit is contained in:
Pavel V. Talanov
2012-07-31 18:38:26 +04:00
parent 942c1ee9d9
commit 0710efdc16
3 changed files with 36 additions and 0 deletions
@@ -152,6 +152,16 @@ public final class MiscTest extends AbstractExpressionTest {
fooBoxTest();
}
public void testNamespaceLevelVarInPackage() throws Exception {
fooBoxIsValue("OK");
}
//TODO: see http://youtrack.jetbrains.com/issue/KT-2564
@SuppressWarnings("UnusedDeclaration")
public void TODO_testNamespaceLevelVarInRoot() throws Exception {
runFunctionOutputTest("namespaceLevelVarInRoot.kt", Namer.getRootNamespaceName(), "box", "OK");
}
public void testLazyPropertyGetterNotCalledOnStart() throws Exception {
checkOutput("lazyProperty.kt", "Hello, world! Gotcha 3");
}
@@ -0,0 +1,14 @@
package foo
var c = 2
fun incC(i: Int) {
c += c + i
}
fun box() : Any? {
for (i in 0..2) {
incC(i)
}
return if (c == 20) "OK" else c
}
@@ -0,0 +1,12 @@
var c = 2
fun incC(i: Int) {
c += c + i
}
fun box() : Any? {
for (i in 0..2) {
incC(i)
}
return if (c == 20) "OK" else c
}