use kotlin Iterable/Iterator
instead of java Iterable/Iterator in Kotlin code in tests
This commit is contained in:
@@ -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"
|
||||
}
|
||||
Reference in New Issue
Block a user