Reformatted.
This commit is contained in:
@@ -19,15 +19,15 @@ class IoTest(){
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fun sample() : Reader {
|
fun sample(): Reader {
|
||||||
return StringReader("Hello\nWorld");
|
return StringReader("Hello\nWorld");
|
||||||
}
|
}
|
||||||
|
|
||||||
test fun testLineIterator() {
|
test fun testLineIterator() {
|
||||||
// TODO we should maybe zap the useLines approach as it encourages
|
// TODO we should maybe zap the useLines approach as it encourages
|
||||||
// use of iterators which don't close the underlying stream
|
// use of iterators which don't close the underlying stream
|
||||||
val list1 = sample().useLines{it.toArrayList()}
|
val list1 = sample().useLines{ it.toArrayList() }
|
||||||
val list2 = sample().useLines<ArrayList<String>>{it.toArrayList()}
|
val list2 = sample().useLines<ArrayList<String>>{ it.toArrayList() }
|
||||||
|
|
||||||
assertEquals(arrayList("Hello", "World"), list1)
|
assertEquals(arrayList("Hello", "World"), list1)
|
||||||
assertEquals(arrayList("Hello", "World"), list2)
|
assertEquals(arrayList("Hello", "World"), list2)
|
||||||
|
|||||||
Reference in New Issue
Block a user