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()
3030internal 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}
0 commit comments