Add tests for newly discovered issue with ECMA5 and top level vars in root scope.
This commit is contained in:
@@ -152,6 +152,16 @@ public final class MiscTest extends AbstractExpressionTest {
|
|||||||
fooBoxTest();
|
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 {
|
public void testLazyPropertyGetterNotCalledOnStart() throws Exception {
|
||||||
checkOutput("lazyProperty.kt", "Hello, world! Gotcha 3");
|
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
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user