use kotlin Iterable/Iterator

instead of java Iterable/Iterator
in Kotlin code in tests
This commit is contained in:
Svetlana Isakova
2012-08-14 15:06:02 +04:00
parent 701295fc04
commit df93a26839
14 changed files with 25 additions and 30 deletions
@@ -2,8 +2,6 @@ package mask
import java.io.*
import java.util.*
import java.util.Iterator as It
import java.lang.Iterable as Itl
fun box() : String {
val input = StringReader("/Users/abreslav/work/jet/docs/luhnybin/src/test")
@@ -88,7 +88,7 @@ class Luhny() {
// fun Char.isDigit() = Character.isDigit(this)
fun java.lang.Iterable<Int>.sum(f : (index : Int, value : Int) -> Int) : Int {
fun Iterable<Int>.sum(f : (index : Int, value : Int) -> Int) : Int {
var sum = 0
var i = 0
for (d in this) {
@@ -6,6 +6,6 @@ val test2 = javaClass<Iterator<Int>> ()
fun box(): String {
if(test.getCanonicalName() != "java.lang.String") return "fail"
if(test2.getCanonicalName() != "jet.Iterator") return "fail"
if(test2.getCanonicalName() != "java.util.Iterator") return "fail"
return "OK"
}