Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion src/main/kotlin/assertk/assertions/inputstream.kt
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -134,6 +134,8 @@ private fun doTheStreamHaveTheSameContent(actual: InputStream, expected: InputSt
throw IllegalStateException("unreachable code")
}

private fun constFunction(): String = "Const Value"

private inline fun <R> use(a: Closeable, b: Closeable, f: () -> R): R {
return a.use { b.use { f() } }
}
Expand Down
7 changes: 7 additions & 0 deletions src/test/kotlin/test/assertk/assertions/InputStreamSpec.kt
Original file line number Diff line number Diff line change
Expand Up @@ -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())
}
}
})


Expand Down