Migrate boxWithJava tests to multi-file framework

This commit is contained in:
Alexander Udalov
2016-03-01 19:18:37 +03:00
parent 0801ae5364
commit 2de7f38427
266 changed files with 2271 additions and 1729 deletions
+33
View File
@@ -0,0 +1,33 @@
// FILE: FortyTwoExtractor.java
public class FortyTwoExtractor {
private Number fortyTwo = new FortyTwo();
public int intValue() {
return fortyTwo.intValue();
}
}
// FILE: FortyTwoExtractor.kt
class FortyTwo : Number() {
override fun toByte() = 42.toByte()
override fun toShort() = 42.toShort()
override fun toInt() = 42
override fun toLong() = 42L
override fun toFloat() = 42.0f
override fun toDouble() = 42.0
override fun toChar() = 42.toChar()
}
fun box(): String {
val extractor = FortyTwoExtractor()
if (extractor.intValue() != 42) return "FAIL"
return "OK"
}