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,9 @@
package foo
fun f(): Int {
var x: Int = 1
x = x + 1
return x
}
fun box() = f() == 2
@@ -0,0 +1,14 @@
package foo
fun box(): Boolean {
var i = 0
do {
if (i == 3) {
break;
}
++i;
}
while ( i < 100)
return i == 3
}
@@ -0,0 +1,13 @@
package foo
fun box(): Boolean {
var i = 0
while ( i < 100) {
if (i == 3) {
break;
}
++i;
}
return i == 3
}
@@ -0,0 +1,9 @@
package foo
class Test() {
}
fun box(): Boolean {
var test = Test()
return true
}
@@ -0,0 +1,9 @@
package foo
fun box(): Boolean {
val a = 2;
val b = 3;
var c = 4;
return (a < c)
}
@@ -0,0 +1,11 @@
package foo
class Test(a: Int, b: Int) {
val c = a
val d = b
}
fun box(): Boolean {
val test = Test(1 + 6 * 3, 10 % 2)
return (test.c == 19) && (test.d == 0)
}
@@ -0,0 +1,10 @@
package foo
class Test(a: Int) {
val b = a
}
fun box(): Boolean {
var test = Test(1)
return (test.b == 1)
}
@@ -0,0 +1,12 @@
package foo
class A(var b: Int, var a: String) {
}
fun box(): Boolean {
val c = A(1, "1")
c.b = 2
c.a = "2"
return (c.b == 2 && c.a == "2")
}
@@ -0,0 +1,16 @@
package foo
fun box(): Boolean {
var i = 0
var b = true
do {
++i;
if (i >= 1) {
continue;
}
b = false;
}
while (i < 100)
return b
}
@@ -0,0 +1,15 @@
package foo
fun box(): Boolean {
var i = 0
var b = true
while (i < 100) {
++i;
if (i >= 1) {
continue;
}
b = false;
}
return b
}
@@ -0,0 +1,18 @@
package foo
fun box(): Boolean {
val a = 50;
var b = 0;
var c = 0;
do {
b = b + 1;
c = c + 2;
}
while (b < a)
if (c == 100) {
return true;
}
return false;
}
@@ -0,0 +1,14 @@
package foo
fun box(): Boolean {
var x = 2;
do {
x = 1;
}
while (3 < 2)
if (x == 1) {
return true;
}
return false;
}
@@ -0,0 +1,21 @@
package foo
fun bor(): Int {
val a = 2;
val b = 3;
var c = 4;
if (a < 2) {
return a;
}
else if (a > 2) {
return b;
}
else if (a == c) {
return c;
}
else {
return 5;
}
}
fun box() = bor() == 5
@@ -0,0 +1,22 @@
package foo
fun bol(): Int {
val a = 2;
val b = 3;
var c = 4;
if (a < 2) {
return a;
}
if (a > 2) {
return b;
}
if (a == c) {
return c;
}
else {
return 5;
}
}
fun box() = bol() == 5
@@ -0,0 +1,6 @@
package foo
fun box(): Boolean {
val a = 2;
return if (a == 2) true else false;
}
@@ -0,0 +1,12 @@
package foo
class Test() {
fun method(): Boolean {
return true;
}
}
fun box(): Boolean {
var test = Test()
return test.method()
}
@@ -0,0 +1,10 @@
package foo
var a = 3
fun box(): Boolean {
a -= 10
return (a == -7)
}
@@ -0,0 +1,5 @@
package foo
fun box(): Boolean {
return !false;
}
@@ -0,0 +1,8 @@
package foo
fun box(): Boolean {
var a = 3
a += 3
return (a == 6)
}
@@ -0,0 +1,7 @@
package foo
fun box(): Boolean {
val b = -3
val c = +3
return (c - b) == 6
}
@@ -0,0 +1,10 @@
package foo
fun box(): Boolean {
var a = 3;
val b = a++;
a--;
a--;
return (a++ == 2) && (b == 3)
}
@@ -0,0 +1,10 @@
package foo
fun box(): Boolean {
var a = 3;
val b = ++a;
--a;
--a;
return (--a == 1) && (b == 4)
}
@@ -0,0 +1,10 @@
package foo
class A(var b: Int, var a: String) {
}
fun box(): Boolean {
val c = A(2, "2")
return (c.b == 2 && c.a == "2")
}
@@ -0,0 +1,9 @@
package foo
class Test() {
val p = true
}
fun box(): Boolean {
return Test().p
}
@@ -0,0 +1,12 @@
package foo
class Test() {
var a: Int
{
$a = 3
}
}
fun box(): Boolean {
return (Test().a == 3);
}
@@ -0,0 +1,17 @@
package foo
fun box(): Boolean {
val a = 50;
var b = 0;
var c = 0;
while (b < a) {
b = b + 1;
c = c + 2;
}
if (c == 100) {
return true;
}
return false;
}
@@ -0,0 +1,10 @@
package foo
fun box(): Boolean {
while (2 < 1) {
return false;
}
return true;
}