diff --git a/ktor-network/common/test/io/ktor/network/sockets/tests/TestUtils.kt b/ktor-network/common/test/io/ktor/network/sockets/tests/TestUtils.kt index d80261d204c..5238dff245d 100644 --- a/ktor-network/common/test/io/ktor/network/sockets/tests/TestUtils.kt +++ b/ktor-network/common/test/io/ktor/network/sockets/tests/TestUtils.kt @@ -1,18 +1,20 @@ /* - * Copyright 2014-2024 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license. + * Copyright 2014-2025 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license. */ package io.ktor.network.sockets.tests import io.ktor.network.selector.* import io.ktor.test.dispatcher.* -import io.ktor.utils.io.core.* -import kotlinx.coroutines.* -import kotlinx.coroutines.test.* -import kotlinx.io.files.* -import kotlin.time.* +import kotlinx.coroutines.CoroutineScope +import kotlinx.coroutines.test.TestResult +import kotlinx.io.files.Path +import kotlinx.io.files.SystemFileSystem +import kotlinx.io.files.SystemTemporaryDirectory +import kotlin.time.Duration import kotlin.time.Duration.Companion.minutes -import kotlin.uuid.* +import kotlin.uuid.ExperimentalUuidApi +import kotlin.uuid.Uuid internal fun testSockets( timeout: Duration = 1.minutes, diff --git a/ktor-network/jsAndWasmShared/src/io/ktor/network/selector/Selectable.jsAndWasmShared.kt b/ktor-network/jsAndWasmShared/src/io/ktor/network/selector/Selectable.jsAndWasmShared.kt index af6710e3ddf..251052156b2 100644 --- a/ktor-network/jsAndWasmShared/src/io/ktor/network/selector/Selectable.jsAndWasmShared.kt +++ b/ktor-network/jsAndWasmShared/src/io/ktor/network/selector/Selectable.jsAndWasmShared.kt @@ -1,11 +1,7 @@ /* - * Copyright 2014-2024 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license. + * Copyright 2014-2025 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license. */ package io.ktor.network.selector -import io.ktor.network.util.* - public actual interface Selectable - -internal actual fun Any.supportsUnixDomainSockets(): Boolean = isAFUnixSupported diff --git a/ktor-network/jsAndWasmShared/test/io/ktor/network/sockets/tests/TestUtils.jsAndWasmShared.kt b/ktor-network/jsAndWasmShared/test/io/ktor/network/sockets/tests/TestUtils.jsAndWasmShared.kt new file mode 100644 index 00000000000..c77c2df5f5c --- /dev/null +++ b/ktor-network/jsAndWasmShared/test/io/ktor/network/sockets/tests/TestUtils.jsAndWasmShared.kt @@ -0,0 +1,7 @@ +/* + * Copyright 2014-2025 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license. + */ + +package io.ktor.network.sockets.tests + +internal actual fun Any.supportsUnixDomainSockets(): Boolean = false diff --git a/ktor-network/jsAndWasmShared/test/io/ktor/network/sockets/tests/TestUtils.kt b/ktor-network/jsAndWasmShared/test/io/ktor/network/sockets/tests/TestUtils.kt deleted file mode 100644 index 51820258638..00000000000 --- a/ktor-network/jsAndWasmShared/test/io/ktor/network/sockets/tests/TestUtils.kt +++ /dev/null @@ -1,7 +0,0 @@ -/* - * Copyright 2014-2024 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license. - */ - -package io.ktor.network.sockets.tests - -internal actual fun Any.supportsUnixDomainSockets(): Boolean = true diff --git a/ktor-network/ios/test/io/ktor/network/sockets/tests/TestUtilsIos.kt b/ktor-network/nix/test/io/ktor/network/sockets/tests/TestUtils.nix.kt similarity index 64% rename from ktor-network/ios/test/io/ktor/network/sockets/tests/TestUtilsIos.kt rename to ktor-network/nix/test/io/ktor/network/sockets/tests/TestUtils.nix.kt index a283858bbb3..a279d4075d2 100644 --- a/ktor-network/ios/test/io/ktor/network/sockets/tests/TestUtilsIos.kt +++ b/ktor-network/nix/test/io/ktor/network/sockets/tests/TestUtils.nix.kt @@ -1,7 +1,9 @@ /* - * Copyright 2014-2021 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license. + * Copyright 2014-2025 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license. */ package io.ktor.network.sockets.tests +import io.ktor.network.util.* + internal actual fun Any.supportsUnixDomainSockets(): Boolean = true diff --git a/ktor-network/posix/test/io/ktor/network/sockets/tests/TestUtils.posix.kt b/ktor-network/posix/test/io/ktor/network/sockets/tests/TestUtils.posix.kt deleted file mode 100644 index df03ca53d52..00000000000 --- a/ktor-network/posix/test/io/ktor/network/sockets/tests/TestUtils.posix.kt +++ /dev/null @@ -1,13 +0,0 @@ -/* - * Copyright 2014-2024 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license. - */ - -package io.ktor.network.sockets.tests - -import kotlin.experimental.* - -@OptIn(ExperimentalNativeApi::class) -internal actual fun Any.supportsUnixDomainSockets(): Boolean = when (Platform.osFamily) { - OsFamily.MACOSX, OsFamily.LINUX -> true - else -> false -} diff --git a/ktor-network/tvos/test/io/ktor/network/sockets/tests/TestUtilsTvos.kt b/ktor-network/tvos/test/io/ktor/network/sockets/tests/TestUtilsTvos.kt deleted file mode 100644 index d1735696240..00000000000 --- a/ktor-network/tvos/test/io/ktor/network/sockets/tests/TestUtilsTvos.kt +++ /dev/null @@ -1,7 +0,0 @@ -/* - * Copyright 2014-2022 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license. - */ - -package io.ktor.network.sockets.tests - -internal actual fun Any.supportsUnixDomainSockets(): Boolean = true diff --git a/ktor-network/watchos/test/io/ktor/network/sockets/tests/TestUtilsWatchos.kt b/ktor-network/watchos/test/io/ktor/network/sockets/tests/TestUtilsWatchos.kt deleted file mode 100644 index d1735696240..00000000000 --- a/ktor-network/watchos/test/io/ktor/network/sockets/tests/TestUtilsWatchos.kt +++ /dev/null @@ -1,7 +0,0 @@ -/* - * Copyright 2014-2022 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license. - */ - -package io.ktor.network.sockets.tests - -internal actual fun Any.supportsUnixDomainSockets(): Boolean = true diff --git a/ktor-network/windows/test/io/ktor/network/sockets/tests/TestUtils.windows.kt b/ktor-network/windows/test/io/ktor/network/sockets/tests/TestUtils.windows.kt new file mode 100644 index 00000000000..8601fd97aff --- /dev/null +++ b/ktor-network/windows/test/io/ktor/network/sockets/tests/TestUtils.windows.kt @@ -0,0 +1,9 @@ +/* + * Copyright 2014-2025 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license. + */ + +package io.ktor.network.sockets.tests + +import io.ktor.network.util.* + +internal actual fun Any.supportsUnixDomainSockets(): Boolean = isAFUnixSupported