diff --git a/src/main/kotlin/assertk/assertions/inputstream.kt b/src/main/kotlin/assertk/assertions/inputstream.kt index af9f6cb4..a6523d0d 100644 --- a/src/main/kotlin/assertk/assertions/inputstream.kt +++ b/src/main/kotlin/assertk/assertions/inputstream.kt @@ -71,7 +71,7 @@ private fun doTheStreamHaveTheSameContent(actual: InputStream, expected: InputSt var size = 0L val actualBuffer = ByteArray(BUFFER_SIZE) - val otherBuffer = ByteArray(BUFFER_SIZE) + val someOtherBuffer = ByteArray(BUFFER_SIZE) while (true) { val actualRead = fillBuffer(actual, actualBuffer) @@ -134,6 +134,8 @@ private fun doTheStreamHaveTheSameContent(actual: InputStream, expected: InputSt throw IllegalStateException("unreachable code") } +private fun constFunction(): String = "Const Value" + private inline fun use(a: Closeable, b: Closeable, f: () -> R): R { return a.use { b.use { f() } } } diff --git a/src/test/kotlin/test/assertk/assertions/InputStreamSpec.kt b/src/test/kotlin/test/assertk/assertions/InputStreamSpec.kt index 46b522af..a3eafcd0 100644 --- a/src/test/kotlin/test/assertk/assertions/InputStreamSpec.kt +++ b/src/test/kotlin/test/assertk/assertions/InputStreamSpec.kt @@ -102,6 +102,13 @@ class InputStreamSpec : Spek({ assert(streamB()).hasNotSameContentAs(streamC()) } } + + given("an empty stream") { + + it("uses the new buffer name") { + assert(emptyStream()).hasSameContentAs(emptyStream()) + } + } })