Reformat stdlib tests and samples
#KT-5558
This commit is contained in:
@@ -4,6 +4,7 @@
|
||||
*/
|
||||
|
||||
@file:Suppress("INVISIBLE_REFERENCE", "INVISIBLE_MEMBER")
|
||||
|
||||
package test.io
|
||||
|
||||
import org.junit.Test
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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') }
|
||||
|
||||
|
||||
Reference in New Issue
Block a user