Reformat stdlib tests and samples

#KT-5558
This commit is contained in:
Ilya Gorbunov
2018-04-23 16:18:24 +03:00
parent add09e0f2e
commit ecf0d7ec0d
39 changed files with 389 additions and 284 deletions
+1
View File
@@ -4,6 +4,7 @@
*/
@file:Suppress("INVISIBLE_REFERENCE", "INVISIBLE_MEMBER")
package test.io
import org.junit.Test
+2 -4
View File
@@ -521,8 +521,7 @@ class FilesTest {
}
var conflicts = 0
src.copyRecursively(dst) {
_: File, e: IOException ->
src.copyRecursively(dst) { _: File, e: IOException ->
if (e is FileAlreadyExistsException) {
conflicts++
OnErrorAction.SKIP
@@ -536,8 +535,7 @@ class FilesTest {
try {
dst.deleteRecursively()
var caught = false
assertTrue(src.copyRecursively(dst) {
_: File, e: IOException ->
assertTrue(src.copyRecursively(dst) { _: File, e: IOException ->
if (e is AccessDeniedException) {
caught = true
OnErrorAction.SKIP
+1 -1
View File
@@ -36,7 +36,7 @@ class IOStreamsTest {
val result = mutableListOf<Byte>()
x.inputStream().buffered().use { stream ->
for(b in stream) {
for (b in stream) {
result += b
}
}
@@ -87,5 +87,5 @@ private fun hexToBytes(value: String): ByteArray = value.split(" ").map { Intege
public fun <T> deserializeFromHex(value: String) = deserializeFromByteArray<T>(hexToBytes(value))
public fun <T> serializeToHex(value: T) =
serializeToByteArray(value).joinToString(" ") { (it.toInt() and 0xFF).toString(16).padStart(2, '0') }
serializeToByteArray(value).joinToString(" ") { (it.toInt() and 0xFF).toString(16).padStart(2, '0') }