Skip to content

Commit 75942b0

Browse files
committed
Spotless apply
1 parent 0cbea49 commit 75942b0

2 files changed

Lines changed: 11 additions & 8 deletions

File tree

jvm/selfie-runner-kotest/src/commonMain/kotlin/com/diffplug/selfie/kotest/FSOkio.kt

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (C) 2024 DiffPlug
2+
* Copyright (C) 2024-2026 DiffPlug
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -30,6 +30,7 @@ internal fun TypedPath.toPath(): okio.Path = absolutePath.toPath()
3030
internal object FSOkio : FS {
3131
override fun fileExists(typedPath: TypedPath): Boolean =
3232
FS_SYSTEM.metadataOrNull(typedPath.toPath())?.isRegularFile ?: false
33+
3334
/** Walks the files (not directories) which are children and grandchildren of the given path. */
3435
override fun <T> fileWalk(typedPath: TypedPath, walk: (Sequence<TypedPath>) -> T): T =
3536
walk(
@@ -40,9 +41,11 @@ internal object FSOkio : FS {
4041
FS_SYSTEM.read(typedPath.toPath()) { readByteArray() }
4142
override fun fileWriteBinary(typedPath: TypedPath, content: ByteArray): Unit =
4243
FS_SYSTEM.write(typedPath.toPath()) { write(content) }
44+
4345
/** Creates an assertion failed exception to throw. */
4446
override fun assertFailed(message: String, expected: Any?, actual: Any?): Throwable =
45-
if (expected == null && actual == null) AssertionErrorBuilder.create().withMessage(message).build()
47+
if (expected == null && actual == null)
48+
AssertionErrorBuilder.create().withMessage(message).build()
4649
else {
4750
val expectedStr = nullableToString(expected, "")
4851
val actualStr = nullableToString(actual, "")
@@ -55,12 +58,11 @@ internal object FSOkio : FS {
5558
comparisonAssertion(message, expectedStr, actualStr)
5659
}
5760
}
58-
private fun nullableToString(any: Any?, onNull: String): String =
59-
any?.toString() ?: onNull
61+
private fun nullableToString(any: Any?, onNull: String): String = any?.toString() ?: onNull
6062
private fun comparisonAssertion(message: String, expected: String, actual: String): Throwable {
6163
return AssertionErrorBuilder.create()
62-
.withMessage(message)
63-
.withValues(Expected(Printed((expected))), Actual(Printed((actual))))
64-
.build()
64+
.withMessage(message)
65+
.withValues(Expected(Printed((expected))), Actual(Printed((actual))))
66+
.build()
6567
}
6668
}

jvm/selfie-runner-kotest/src/commonMain/kotlin/com/diffplug/selfie/kotest/SelfieExtension.kt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (C) 2024 DiffPlug
2+
* Copyright (C) 2024-2026 DiffPlug
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -67,6 +67,7 @@ class SelfieExtension(
6767
}
6868
return system.forClassOrFilename(classOrFilename)
6969
}
70+
7071
/** Called for every test method. */
7172
override suspend fun intercept(
7273
testCase: TestCase,

0 commit comments

Comments
 (0)