group codegen test files into directories per test case

This commit is contained in:
Dmitry Jemerov
2011-05-13 12:30:28 +02:00
parent e57ed7401d
commit 5c2e90345a
24 changed files with 21 additions and 21 deletions
@@ -0,0 +1,10 @@
fun fac(i: Int): Int {
var count = 1;
var result = 1;
while(true) {
count = count + 1;
result = result * count;
if (count == i) break;
}
return result;
}
@@ -0,0 +1,10 @@
fun continue_test(i: Int): Int {
var count = i;
var result = 0;
while(count > 0) {
count = count - 1;
if (count <= 2) continue;
result = result + count;
}
return result;
}
@@ -0,0 +1,9 @@
fun fac(i: Int): Int {
var count = 1;
var result = 1;
do {
count = count + 1;
result = result * count;
} while(count != i);
return result;
}
@@ -0,0 +1,9 @@
import java.util.*
fun concat(l: List<String>): String? {
val sb = new StringBuilder()
for(s in l) {
sb.append(s)
}
sb.toString()
}
@@ -0,0 +1,7 @@
fun concat(l: Array<String>): String? {
val sb = new StringBuilder()
for(s in l) {
sb.append(s)
}
sb.toString()
}
@@ -0,0 +1 @@
fun foo(b: Boolean): Int { return if (b) 15 else 20 }
@@ -0,0 +1,5 @@
fun f(x: Int, b: Boolean): Int {
var result = x;
if (b) else result = result + 5;
return result;
}
@@ -0,0 +1,4 @@
fun foo(b: Boolean) : Int {
if (b) return 15;
return 20;
}
@@ -0,0 +1,9 @@
fun foo(s: String): String? {
try {
Integer.parseInt(s);
return "no message";
}
catch(e: NumberFormatException) {
return (e : Throwable).getMessage(); // Work around an overload-resolution bug
}
}
@@ -0,0 +1,9 @@
fun fac(i: Int): Int {
var count = 1;
var result = 1;
while(count < i) {
count = count + 1;
result = result * count;
}
return result;
}