Move blackBoxFile() testData to box/ directory

Delete all test methods (and empty test classes), since they'll be
auto-generated
This commit is contained in:
Alexander Udalov
2013-01-25 16:13:45 +04:00
committed by Alexander Udalov
parent ecbb2f10ef
commit 41a416da60
438 changed files with 156 additions and 2005 deletions
@@ -1,12 +0,0 @@
class C(val p: Boolean) { }
fun box(): String {
val c = C(true)
// Commented for KT-621
// return when(c) {
// .p => "OK"
// else => "fail"
// }
return if (c.p) "OK" else "fail"
}
@@ -1,11 +0,0 @@
fun typeName(a: Any?) : String {
return when(a) {
is java.util.ArrayList<*> -> "array list"
else -> "no idea"
}
}
fun box() : String {
if(typeName(java.util.ArrayList<Int> ()) != "array list") return "array list failed"
return "OK"
}
@@ -1,9 +0,0 @@
fun foo(b: Boolean) =
when (b) {
false -> 0
true -> 1
else -> 2
}
fun box(): String = if (foo(false) == 0 && foo(true) == 1) "OK" else "Fail"
@@ -1,9 +0,0 @@
class LongR {
fun contains(l : Long): Boolean = l == 5.toLong()
}
fun box(): String {
if (5 !in LongR()) return "fail 1"
if (6 in LongR()) return "fail 2"
return "OK"
}
@@ -1,7 +0,0 @@
fun foo(i: Int, j: Int?): String =
when (i) {
j -> "OK"
else -> "Fail"
}
fun box(): String = foo(0, 0)
@@ -1,13 +0,0 @@
// KT-2148
fun f(p: Int?): Int {
return when(p) {
null -> 3
else -> p!!
}
}
fun box(): String {
return if (f(null) == 3) "OK" else "fail"
}
@@ -1,29 +0,0 @@
fun isDigit(a: Int) : String {
val aa = java.util.ArrayList<Int> ()
aa.add(239)
return when(a) {
in aa -> "array list"
in 0..9 -> "digit"
!in 0..100 -> "not small"
else -> "something"
}
}
fun assertDigit(i: Int, expected: String): String {
val result = isDigit(i)
return if (result == expected) "" else "fail: isDigit($i) = \"$result\""
}
fun box(): String {
val result =
assertDigit(239, "array list") +
assertDigit(0, "digit") +
assertDigit(9, "digit") +
assertDigit(5, "digit") +
assertDigit(19, "something") +
assertDigit(190, "not small")
if (result == "") return "OK"
return result
}
@@ -1,13 +0,0 @@
var x = 0
fun inc(): Int {
x++
return 0
}
fun box(): String {
val al = java.util.ArrayList<Int>()
when (inc()) {
in al -> return "fail 1"
else -> {}
}
return if (x == 1) "OK" else "fail 2"
}