
commonTest.okio.UseTest.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of polaris-all Show documentation
Show all versions of polaris-all Show documentation
All in one project for polaris-java
package okio
import kotlin.test.Test
import okio.Path.Companion.toPath
import okio.fakefilesystem.FakeFileSystem
class UseTest {
val fakeFileSystem = FakeFileSystem(clock = FakeClock()).also { it.emulateUnix() }
val base = "/cache".toPath().also {
fakeFileSystem.createDirectories(it)
}
@Test
fun closesWithUseBlock() {
fun testMethodWithUse() {
val sink = fakeFileSystem.sink(base / "all-files-includes-file")
sink.use {
return@testMethodWithUse
}
}
testMethodWithUse()
fakeFileSystem.checkNoOpenFiles()
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy