JS backend: testFiles -> testData

This commit is contained in:
Zalim Bashorov
2014-02-26 15:39:46 +04:00
parent bcd579acdd
commit 442215e829
490 changed files with 0 additions and 0 deletions
@@ -0,0 +1,28 @@
package foo
class A {
}
object test {
var c = 2;
var b = 1;
}
object aWrapper {
var a = A();
}
fun box(): Boolean {
if (test.c != 2) return false;
if (test.b != 1) return false;
test.c += 10
if (test.c != 12) {
return false;
}
if (aWrapper.a !is A) {
return false
}
return true;
}
@@ -0,0 +1,12 @@
package foo
object State {
val c = 2
val b = 1
}
fun box(): Boolean {
if (State.c != 2) return false
if (State.b != 1) return false
return true
}
@@ -0,0 +1,15 @@
package foo
class A() {
fun f(): Boolean {
object t {
val c = true;
}
val z = object {
val c = true
}
return t.c && z.c
}
}
fun box() = A().f();
@@ -0,0 +1,28 @@
package foo
object A {
object query {
val status = "complete"
}
}
object B {
private val ov = "d"
object query {
val status = "complete" + ov
}
}
class C {
class object {
fun ov() = "d"
}
object query {
val status = "complete" + ov()
}
}
fun box() = A.query.status == "complete" && B.query.status == "completed"
// todo fix after KT-3868 will be fixed
// && C.query.status == "completed"
@@ -0,0 +1,18 @@
package foo
class Foo {
fun bar(param: String): String {
val local = "world!"
var a = object {
object b {
val bar = param + local
}
}
return a.b.bar
}
}
fun box(): Boolean {
return Foo().bar("hello ") == "hello world!"
}
@@ -0,0 +1,25 @@
package foo
trait Foo {
fun execute(handler: () -> Unit) {
execute(false, handler)
}
fun execute(onlyIfAttached: Boolean, handler: () -> Unit)
}
object foo : Foo {
override fun execute(onlyIfAttached: Boolean, handler: () -> Unit) {
handler()
}
}
private var result = false
fun box(): Boolean {
foo.execute() {
result = true
}
return result
}
@@ -0,0 +1,9 @@
package foo
abstract class A(val s: String) {
}
object B : A("test") {
}
fun box() = B.s == "test"
@@ -0,0 +1,22 @@
package foo
class Test {
private val a = object {
fun c() = 3
fun b() = 2
}
fun doTest(): Boolean {
if (a.c() != 3) {
return false;
}
if (a.b() != 2) {
return false;
}
return true;
}
}
fun box(): Boolean {
return Test().doTest();
}