Deprecate createTempFile/createTempDir functions

Document their potential permission problems.
Suppress this deprecation in tests.
This commit is contained in:
Ilya Gorbunov
2020-10-28 09:47:31 +03:00
parent 31bfc7d4e3
commit 66f5c98505
4 changed files with 46 additions and 13 deletions
+2 -2
View File
@@ -12,7 +12,7 @@ import kotlin.random.Random
class IOStreamsTest {
@Test fun testGetStreamOfFile() {
val tmpFile = createTempFile()
val tmpFile = @Suppress("DEPRECATION") createTempFile()
var writer: Writer? = null
try {
writer = tmpFile.outputStream().writer()
@@ -46,7 +46,7 @@ class IOStreamsTest {
}
@Test fun readWriteBytes() {
val file = createTempFile("temp", Random.nextLong().toString())
val file = @Suppress("DEPRECATION") createTempFile("temp", Random.nextLong().toString())
try {
val bytes = Random.nextBytes(256_000)