From 530920df913dd783c69916bad9b9dd722fd32264 Mon Sep 17 00:00:00 2001 From: Luca Kellermann Date: Tue, 17 Sep 2024 18:42:58 +0200 Subject: [PATCH] Update Kotlin to 2.1.0-Beta1 KT-31799 [1] is fixed with Kotlin 2.1.0-Beta1, so most @JsName annotations are no longer necessary. KSP 2.0.20-1.0.24 works with Kotlin 2.1.0-Beta1, so the locally built KSP is no longer necessary. [1] https://youtrack.jetbrains.com/issue/KT-31799 --- build.gradle.kts | 2 -- buildSrc/build.gradle.kts | 2 -- .../kotlin/kord-internal-module.gradle.kts | 2 -- ...d-internal-multiplatform-module.gradle.kts | 2 -- .../src/main/kotlin/kord-module.gradle.kts | 2 -- .../kord-multiplatform-module.gradle.kts | 2 -- .../kotlin/entity/optional/Optional.kt | 4 --- .../optional/delegate/OptionalDelegate.kt | 2 -- .../optional/delegate/OptionalIntDelegate.kt | 2 -- common/src/commonTest/kotlin/BitSetTests.kt | 10 ------- common/src/commonTest/kotlin/ColorTests.kt | 4 --- common/src/commonTest/kotlin/LocaleTest.kt | 3 -- .../commonTest/kotlin/entity/SnowflakeTest.kt | 13 --------- .../entity/optional/OptionalBooleanTest.kt | 5 ---- .../kotlin/entity/optional/OptionalIntTest.kt | 10 +++---- .../entity/optional/OptionalLongTest.kt | 10 +++---- .../entity/optional/OptionalSnowflakeTest.kt | 10 +++---- .../kotlin/entity/optional/OptionalTest.kt | 8 ----- .../src/commonTest/kotlin/json/ChannelTest.kt | 9 +----- .../src/commonTest/kotlin/json/EmojiTest.kt | 4 --- .../src/commonTest/kotlin/json/GuildTest.kt | 5 ---- .../commonTest/kotlin/json/InteractionTest.kt | 6 ---- .../src/commonTest/kotlin/json/MessageTest.kt | 7 ++--- .../commonTest/kotlin/json/PermissionsTest.kt | 3 -- common/src/commonTest/kotlin/json/UserTest.kt | 2 -- .../commonTest/kotlin/json/VoiceStateTest.kt | 2 -- .../AbstractIntervalRateLimiterTest.kt | 4 --- .../serialization/DurationSerializersTests.kt | 14 --------- .../serialization/InstantSerializersTests.kt | 13 --------- .../src/commonTest/kotlin/KordTest.kt | 2 -- .../src/commonTest/kotlin/StrategyTest.kt | 4 --- .../kotlin/regression/CacheMissRegression.kt | 3 -- core/src/commonTest/kotlin/UtilKtTest.kt | 3 -- .../kotlin/cache/data/ComponentDataTest.kt | 2 -- .../kotlin/gateway/MasterGatewayTest.kt | 4 --- .../commonTest/kotlin/live/LiveGuildTest.kt | 29 ------------------- .../kotlin/live/LiveKordEntityTest.kt | 7 ----- .../commonTest/kotlin/live/LiveMemberTest.kt | 5 ---- .../commonTest/kotlin/live/LiveMessageTest.kt | 11 ------- .../commonTest/kotlin/live/LiveRoleTest.kt | 4 --- .../commonTest/kotlin/live/LiveUserTest.kt | 2 -- .../kotlin/live/channel/LiveCategoryTest.kt | 2 -- .../kotlin/live/channel/LiveChannelTest.kt | 4 --- .../kotlin/live/channel/LiveDmChannelTest.kt | 2 -- .../live/channel/LiveGuildChannelTest.kt | 2 -- .../kotlin/live/channel/LiveGuildTextTest.kt | 2 -- .../live/channel/LiveVoiceChannelTest.kt | 2 -- .../kotlin/performance/KordEventDropTest.kt | 2 -- .../kotlin/regression/ReactionEmojiTest.kt | 2 -- .../supplier/CacheEntitySupplierTest.kt | 2 -- .../commonTest/kotlin/DefaultGatewayTest.kt | 2 -- .../src/commonTest/kotlin/json/CommandTest.kt | 7 ----- .../commonTest/kotlin/json/RegressionTests.kt | 5 ---- .../kotlin/json/SerializationTest.kt | 11 ------- .../commonTest/kotlin/json/SnowflakeTest.kt | 6 ---- .../ratelimit/IdentifyRateLimiterTest.kt | 14 +++------ gradle/libs.versions.toml | 4 +-- .../builder/CategoryModifyBuilderTest.kt | 2 -- .../builder/EditGuildChannelBuilderTest.kt | 4 --- .../kotlin/builder/EmojiModifyBuilderTest.kt | 2 -- .../kotlin/builder/MemberModifyBuilderTest.kt | 2 -- .../builder/guild/GuildModifyBuilderTest.kt | 2 -- .../kotlin/json/AuditLogResponseTest.kt | 2 -- rest/src/commonTest/kotlin/json/ErrorTest.kt | 2 -- .../AbstractRequestRateLimiterTest.kt | 7 ----- .../kotlin/request/MessageRequests.kt | 2 -- .../kotlin/request/StackTraceRecoveryTest.kt | 2 -- 67 files changed, 22 insertions(+), 312 deletions(-) diff --git a/build.gradle.kts b/build.gradle.kts index fa2b8190fc1..0ad64bff26f 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -4,8 +4,6 @@ plugins { repositories { mavenCentral() - maven("https://maven.pkg.jetbrains.space/kotlin/p/kotlin/bootstrap") - mavenLocal() } group = Library.group diff --git a/buildSrc/build.gradle.kts b/buildSrc/build.gradle.kts index 95e5b79cce5..260920e5258 100644 --- a/buildSrc/build.gradle.kts +++ b/buildSrc/build.gradle.kts @@ -4,8 +4,6 @@ plugins { repositories { mavenCentral() - maven("https://maven.pkg.jetbrains.space/kotlin/p/kotlin/bootstrap") - mavenLocal() } kotlin { diff --git a/buildSrc/src/main/kotlin/kord-internal-module.gradle.kts b/buildSrc/src/main/kotlin/kord-internal-module.gradle.kts index 49fabff4004..ad9b04bb4d1 100644 --- a/buildSrc/src/main/kotlin/kord-internal-module.gradle.kts +++ b/buildSrc/src/main/kotlin/kord-internal-module.gradle.kts @@ -4,8 +4,6 @@ plugins { repositories { mavenCentral() - maven("https://maven.pkg.jetbrains.space/kotlin/p/kotlin/bootstrap") - mavenLocal() } kotlin { diff --git a/buildSrc/src/main/kotlin/kord-internal-multiplatform-module.gradle.kts b/buildSrc/src/main/kotlin/kord-internal-multiplatform-module.gradle.kts index 7c9c2a170ad..076b387f80e 100644 --- a/buildSrc/src/main/kotlin/kord-internal-multiplatform-module.gradle.kts +++ b/buildSrc/src/main/kotlin/kord-internal-multiplatform-module.gradle.kts @@ -6,8 +6,6 @@ plugins { repositories { mavenCentral() - maven("https://maven.pkg.jetbrains.space/kotlin/p/kotlin/bootstrap") - mavenLocal() } @OptIn(ExperimentalKotlinGradlePluginApi::class) diff --git a/buildSrc/src/main/kotlin/kord-module.gradle.kts b/buildSrc/src/main/kotlin/kord-module.gradle.kts index ce44c7da25c..19322086bd4 100644 --- a/buildSrc/src/main/kotlin/kord-module.gradle.kts +++ b/buildSrc/src/main/kotlin/kord-module.gradle.kts @@ -12,8 +12,6 @@ plugins { repositories { mavenCentral() - maven("https://maven.pkg.jetbrains.space/kotlin/p/kotlin/bootstrap") - mavenLocal() } dependencies { diff --git a/buildSrc/src/main/kotlin/kord-multiplatform-module.gradle.kts b/buildSrc/src/main/kotlin/kord-multiplatform-module.gradle.kts index 5c4bca6a883..5a28f04dd8c 100644 --- a/buildSrc/src/main/kotlin/kord-multiplatform-module.gradle.kts +++ b/buildSrc/src/main/kotlin/kord-multiplatform-module.gradle.kts @@ -13,8 +13,6 @@ plugins { repositories { mavenCentral() - maven("https://maven.pkg.jetbrains.space/kotlin/p/kotlin/bootstrap") - mavenLocal() } dependencies { diff --git a/common/src/commonMain/kotlin/entity/optional/Optional.kt b/common/src/commonMain/kotlin/entity/optional/Optional.kt index 561a6bd85e7..b64d4847b17 100644 --- a/common/src/commonMain/kotlin/entity/optional/Optional.kt +++ b/common/src/commonMain/kotlin/entity/optional/Optional.kt @@ -9,7 +9,6 @@ import kotlinx.serialization.SerializationException import kotlinx.serialization.descriptors.SerialDescriptor import kotlinx.serialization.encoding.Decoder import kotlinx.serialization.encoding.Encoder -import kotlin.js.JsName import kotlin.jvm.JvmName /** @@ -145,7 +144,6 @@ public sealed class Optional { * Returns an [Optional] that is either [value] on a non-null [value], or [Null] on `null`. */ @JvmName("invokeNullable") - @JsName("invokeNullable") public operator fun invoke(value: T?): Optional = when (value) { null -> Null() else -> Value(value) @@ -265,7 +263,6 @@ public inline fun Optional.flatMap(mapper: (E) -> Optional @Suppress("UNCHECKED_CAST") @JvmName("mapNullableOptional") -@JsName("mapNullableOptional") public inline fun Optional.map(mapper: (E) -> T): Optional = when (this) { is Missing, is Null<*> -> this as Optional is Value -> Value(mapper(value!!)) @@ -299,7 +296,6 @@ public inline fun Optional.mapSnowflake(mapper: (E) -> Snowflake): } @JvmName("mapNullableSnowflake") -@JsName("mapNullableSnowflake") public inline fun Optional.mapSnowflake(mapper: (E) -> Snowflake): OptionalSnowflake = when (this) { is Missing, is Null<*> -> OptionalSnowflake.Missing is Value -> OptionalSnowflake.Value(mapper(value!!)) diff --git a/common/src/commonMain/kotlin/entity/optional/delegate/OptionalDelegate.kt b/common/src/commonMain/kotlin/entity/optional/delegate/OptionalDelegate.kt index cf5f6517d4b..2fbb4e4fa06 100644 --- a/common/src/commonMain/kotlin/entity/optional/delegate/OptionalDelegate.kt +++ b/common/src/commonMain/kotlin/entity/optional/delegate/OptionalDelegate.kt @@ -1,7 +1,6 @@ package dev.kord.common.entity.optional.delegate import dev.kord.common.entity.optional.Optional -import kotlin.js.JsName import kotlin.jvm.JvmName import kotlin.properties.ReadWriteProperty import kotlin.reflect.KMutableProperty0 @@ -44,7 +43,6 @@ public fun KMutableProperty0>>.delegateList(): ReadWr } @JvmName("provideNullableDelegate") -@JsName("provideNullableDelegate") public fun KMutableProperty0>.delegate(): ReadWriteProperty = object : ReadWriteProperty { diff --git a/common/src/commonMain/kotlin/entity/optional/delegate/OptionalIntDelegate.kt b/common/src/commonMain/kotlin/entity/optional/delegate/OptionalIntDelegate.kt index 239c8e84410..d91c77fccd7 100644 --- a/common/src/commonMain/kotlin/entity/optional/delegate/OptionalIntDelegate.kt +++ b/common/src/commonMain/kotlin/entity/optional/delegate/OptionalIntDelegate.kt @@ -3,13 +3,11 @@ package dev.kord.common.entity.optional.delegate import dev.kord.common.entity.optional.OptionalInt import dev.kord.common.entity.optional.optionalInt import dev.kord.common.entity.optional.value -import kotlin.js.JsName import kotlin.jvm.JvmName import kotlin.properties.ReadWriteProperty import kotlin.reflect.KMutableProperty0 import kotlin.reflect.KProperty -@JsName("intDelegate") public fun KMutableProperty0.delegate(): ReadWriteProperty = object : ReadWriteProperty { override fun getValue(thisRef: Any?, property: KProperty<*>): Int? { diff --git a/common/src/commonTest/kotlin/BitSetTests.kt b/common/src/commonTest/kotlin/BitSetTests.kt index e70cde4e0b5..e5caa2e733e 100644 --- a/common/src/commonTest/kotlin/BitSetTests.kt +++ b/common/src/commonTest/kotlin/BitSetTests.kt @@ -4,14 +4,12 @@ import kotlinx.serialization.encodeToString import kotlinx.serialization.json.Json import kotlinx.serialization.json.JsonPrimitive import kotlinx.serialization.json.encodeToJsonElement -import kotlin.js.JsName import kotlin.random.Random import kotlin.random.nextLong import kotlin.test.* class BitSetTests { @Test - @JsName("test1") fun `a contains b and c`() { val a = DiscordBitSet(0b111) val b = DiscordBitSet(0b101) @@ -21,7 +19,6 @@ class BitSetTests { } @Test - @JsName("test2") fun `a and b are equal and have the same hashCode`() { val a = DiscordBitSet(0b111, 0) val b = DiscordBitSet(0b111) @@ -30,7 +27,6 @@ class BitSetTests { } @Test - @JsName("test3") fun `a does not equal b`() { val a = DiscordBitSet(0b111, 0) val b = DiscordBitSet(0b111, 0b1) @@ -38,7 +34,6 @@ class BitSetTests { } @Test - @JsName("test4") fun `get bits`() { val a = DiscordBitSet(0b101, 0) assertTrue(a[0]) @@ -52,7 +47,6 @@ class BitSetTests { } @Test - @JsName("test5") fun `set bits`() { val a = EmptyBitSet() for (i in 0..64) a[i] = true @@ -68,14 +62,12 @@ class BitSetTests { } @Test - @JsName("test6") fun `get a bit out of range`() { val a = DiscordBitSet(0b101, 0) assertFalse(a[10000]) } @Test - @JsName("test7") fun `add and remove a bit`() { val a = DiscordBitSet(0b101, 0) a.add(DiscordBitSet(0b111)) @@ -85,7 +77,6 @@ class BitSetTests { } @Test - @JsName("test8") fun `remove a bit`() { val a = DiscordBitSet(0b101, 0) a.remove(DiscordBitSet(0b111)) @@ -93,7 +84,6 @@ class BitSetTests { } @Test - @JsName("test9") fun `binary works`() { assertEquals("0", DiscordBitSet().binary) assertEquals("0", DiscordBitSet(0).binary) diff --git a/common/src/commonTest/kotlin/ColorTests.kt b/common/src/commonTest/kotlin/ColorTests.kt index 5dfd63076ae..7745cf580d9 100644 --- a/common/src/commonTest/kotlin/ColorTests.kt +++ b/common/src/commonTest/kotlin/ColorTests.kt @@ -1,19 +1,16 @@ package dev.kord.common -import kotlin.js.JsName import kotlin.test.Test import kotlin.test.assertEquals import kotlin.test.assertFailsWith class ColorTests { @Test - @JsName("test1") fun `Color throws if invalid rgb value is provided`() { assertFailsWith { Color(256, 256, 300) } } @Test - @JsName("test2") fun `Color provides a correct value`() { val red = Color(0xFF0000) assertEquals(255, red.red) @@ -28,7 +25,6 @@ class ColorTests { } @Test - @JsName("test3") fun `Color implementation should drop alpha values if given`() { val color = Color(0x1E1F2E3D) assertEquals(0x1F2E3D, color.rgb) diff --git a/common/src/commonTest/kotlin/LocaleTest.kt b/common/src/commonTest/kotlin/LocaleTest.kt index 1ca6db9348e..6939d9a944d 100644 --- a/common/src/commonTest/kotlin/LocaleTest.kt +++ b/common/src/commonTest/kotlin/LocaleTest.kt @@ -2,7 +2,6 @@ package dev.kord.common import kotlinx.serialization.encodeToString import kotlinx.serialization.json.Json -import kotlin.js.JsName import kotlin.test.Test import kotlin.test.assertEquals @@ -51,7 +50,6 @@ class LocaleTest { @Test - @JsName("test1") fun `all documented Locales can be deserialized`() { all.forEach { (string, locale) -> assertEquals(expected = locale, actual = Json.decodeFromString("\"$string\"")) @@ -59,7 +57,6 @@ class LocaleTest { } @Test - @JsName("test2") fun `all documented Locales can be serialized`() { all.forEach { (string, locale) -> assertEquals(expected = "\"$string\"", actual = Json.encodeToString(locale)) diff --git a/common/src/commonTest/kotlin/entity/SnowflakeTest.kt b/common/src/commonTest/kotlin/entity/SnowflakeTest.kt index 6a52cfdc51a..8761b7297e0 100644 --- a/common/src/commonTest/kotlin/entity/SnowflakeTest.kt +++ b/common/src/commonTest/kotlin/entity/SnowflakeTest.kt @@ -2,7 +2,6 @@ package dev.kord.common.entity import kotlinx.datetime.Clock import kotlinx.datetime.Instant -import kotlin.js.JsName import kotlin.test.* import kotlin.time.Duration.Companion.milliseconds import kotlin.time.Duration.Companion.nanoseconds @@ -10,54 +9,46 @@ import kotlin.time.Duration.Companion.nanoseconds class SnowflakeTest { @Test - @JsName("test1") fun `min Snowflake's timestamp is equal to discordEpoch`() { assertEquals(Snowflake.discordEpoch, Snowflake.min.timestamp) } @Test - @JsName("test2") fun `max Snowflake's timestamp is equal to endOfTime`() { assertEquals(Snowflake.endOfTime, Snowflake.max.timestamp) } @Test - @JsName("test3") fun `Snowflake created from ULong MIN_VALUE has timestamp equal to discordEpoch`() { val snowflake = Snowflake(ULong.MIN_VALUE) assertEquals(Snowflake.discordEpoch, snowflake.timestamp) } @Test - @JsName("test4") fun `Snowflake created from ULong MAX_VALUE has timestamp equal to endOfTime`() { val snowflake = Snowflake(ULong.MAX_VALUE) assertEquals(Snowflake.endOfTime, snowflake.timestamp) } @Test - @JsName("test5") fun `Snowflake created from Long MIN_VALUE has timestamp equal to discordEpoch`() { val snowflake = Snowflake(Long.MIN_VALUE) assertEquals(Snowflake.discordEpoch, snowflake.timestamp) } @Test - @JsName("test6") fun `Snowflake created from instant far in the past has timestamp equal to discordEpoch`() { val snowflake = Snowflake(Instant.DISTANT_PAST) assertEquals(Snowflake.discordEpoch, snowflake.timestamp) } @Test - @JsName("test7") fun `Snowflake created from instant far in the future has timestamp equal to endOfTime`() { val snowflake = Snowflake(Instant.DISTANT_FUTURE) assertEquals(Snowflake.endOfTime, snowflake.timestamp) } @Test - @JsName("test8") fun `Snowflake's timestamp calculates an Instant close to the Instant the Snowflake was created from`() { val instant = Clock.System.now() val snowflake = Snowflake(instant) @@ -70,19 +61,16 @@ class SnowflakeTest { } @Test - @JsName("test9") fun `min Snowflake's timeMark has passed`() { assertTrue(Snowflake.min.timeMark.hasPassedNow()) } @Test - @JsName("test10") fun `max Snowflake's timeMark has not passed`() { assertFalse(Snowflake.max.timeMark.hasPassedNow()) } @Test - @JsName("test11") fun `Snowflake can be destructured`() { val snowflake = Snowflake(0b110010110111_10111_01101_101100111101_u) val (timestamp, worker, process, increment) = snowflake @@ -99,7 +87,6 @@ class SnowflakeTest { } @Test - @JsName("test12") fun `Snowflakes are compared correctly`() { // timestamp worker process increment // vvv vvv vvv vvv diff --git a/common/src/commonTest/kotlin/entity/optional/OptionalBooleanTest.kt b/common/src/commonTest/kotlin/entity/optional/OptionalBooleanTest.kt index 687a8656944..f2c6af3b4e4 100644 --- a/common/src/commonTest/kotlin/entity/optional/OptionalBooleanTest.kt +++ b/common/src/commonTest/kotlin/entity/optional/OptionalBooleanTest.kt @@ -2,9 +2,7 @@ package dev.kord.common.entity.optional import kotlinx.serialization.Serializable import kotlinx.serialization.SerializationException -import kotlinx.serialization.decodeFromString import kotlinx.serialization.json.Json -import kotlin.js.JsName import kotlin.test.Test import kotlin.test.assertFailsWith import kotlin.test.assertIs @@ -16,7 +14,6 @@ internal class OptionalBooleanTest { private class EmptyOptionalEntity(val value: OptionalBoolean = OptionalBoolean.Missing) @Test - @JsName("test1") fun `deserializing nothing in optional assigns Missing`(){ //language=json val json = """{}""" @@ -30,7 +27,6 @@ internal class OptionalBooleanTest { private class NullOptionalEntity(@Suppress("unused") val value: OptionalBoolean = OptionalBoolean.Missing) @Test - @JsName("test2") fun `deserializing null in optional throws SerializationException`(){ //language=json val json = """{ "value":null }""" @@ -44,7 +40,6 @@ internal class OptionalBooleanTest { private class ValueOptionalEntity(val value: OptionalBoolean = OptionalBoolean.Missing) @Test - @JsName("test3") fun `deserializing value in optional assigns Value`(){ //language=json val json = """{ "value":true }""" diff --git a/common/src/commonTest/kotlin/entity/optional/OptionalIntTest.kt b/common/src/commonTest/kotlin/entity/optional/OptionalIntTest.kt index fcd994c462e..686f47278e8 100644 --- a/common/src/commonTest/kotlin/entity/optional/OptionalIntTest.kt +++ b/common/src/commonTest/kotlin/entity/optional/OptionalIntTest.kt @@ -2,10 +2,11 @@ package dev.kord.common.entity.optional import kotlinx.serialization.Serializable import kotlinx.serialization.SerializationException -import kotlinx.serialization.decodeFromString import kotlinx.serialization.json.Json -import kotlin.js.JsName -import kotlin.test.* +import kotlin.test.Test +import kotlin.test.assertFailsWith +import kotlin.test.assertIs +import kotlin.test.assertSame internal class OptionalIntTest { @@ -13,7 +14,6 @@ internal class OptionalIntTest { private class EmptyOptionalEntity(val value: OptionalInt = OptionalInt.Missing) @Test - @JsName("test1") fun `deserializing nothing in optional assigns Missing`(){ //language=json val json = """{}""" @@ -28,7 +28,6 @@ internal class OptionalIntTest { private class NullOptionalEntity(@Suppress("unused") val value: OptionalInt = OptionalInt.Missing) @Test - @JsName("test2") fun `deserializing null in optional throws SerializationException`(){ //language=json val json = """{ "value":null }""" @@ -43,7 +42,6 @@ internal class OptionalIntTest { class ValueOptionalEntity(val value: OptionalInt = OptionalInt.Missing) @Test - @JsName("test3") fun `deserializing value in optional assigns Value`(){ //language=json val json = """{ "value":5 }""" diff --git a/common/src/commonTest/kotlin/entity/optional/OptionalLongTest.kt b/common/src/commonTest/kotlin/entity/optional/OptionalLongTest.kt index f576edae6e3..da4d662b206 100644 --- a/common/src/commonTest/kotlin/entity/optional/OptionalLongTest.kt +++ b/common/src/commonTest/kotlin/entity/optional/OptionalLongTest.kt @@ -2,10 +2,11 @@ package dev.kord.common.entity.optional import kotlinx.serialization.Serializable import kotlinx.serialization.SerializationException -import kotlinx.serialization.decodeFromString import kotlinx.serialization.json.Json -import kotlin.js.JsName -import kotlin.test.* +import kotlin.test.Test +import kotlin.test.assertEquals +import kotlin.test.assertFailsWith +import kotlin.test.assertIs internal class OptionalLongTest { @@ -13,7 +14,6 @@ internal class OptionalLongTest { class EmptyOptionalEntity(val value: OptionalLong = OptionalLong.Missing) @Test - @JsName("test1") fun `deserializing nothing in optional assigns Missing`() { //language=json val json = """{}""" @@ -29,7 +29,6 @@ internal class OptionalLongTest { class NullOptionalEntity(val value: OptionalLong = OptionalLong.Missing) @Test - @JsName("test2") fun `deserializing null in optional throws SerializationException`() { //language=json val json = """{ "value":null }""" @@ -45,7 +44,6 @@ internal class OptionalLongTest { class ValueOptionalEntity(val value: OptionalLong = OptionalLong.Missing) @Test - @JsName("test3") fun `deserializing value in optional assigns Value`() { //language=json val json = """{ "value":5 }""" diff --git a/common/src/commonTest/kotlin/entity/optional/OptionalSnowflakeTest.kt b/common/src/commonTest/kotlin/entity/optional/OptionalSnowflakeTest.kt index 2ff3cf3a409..f6f0226f68f 100644 --- a/common/src/commonTest/kotlin/entity/optional/OptionalSnowflakeTest.kt +++ b/common/src/commonTest/kotlin/entity/optional/OptionalSnowflakeTest.kt @@ -3,10 +3,11 @@ package dev.kord.common.entity.optional import dev.kord.common.entity.Snowflake import kotlinx.serialization.Serializable import kotlinx.serialization.SerializationException -import kotlinx.serialization.decodeFromString import kotlinx.serialization.json.Json -import kotlin.js.JsName -import kotlin.test.* +import kotlin.test.Test +import kotlin.test.assertEquals +import kotlin.test.assertFailsWith +import kotlin.test.assertIs internal class OptionalSnowflakeTest { @@ -15,7 +16,6 @@ internal class OptionalSnowflakeTest { class EmptyOptionalEntity(val value: OptionalSnowflake = OptionalSnowflake.Missing) @Test - @JsName("test1") fun `deserializing nothing in optional assigns Missing`() { //language=json val json = """{}""" @@ -31,7 +31,6 @@ internal class OptionalSnowflakeTest { class NullOptionalEntity(val value: OptionalSnowflake = OptionalSnowflake.Missing) @Test - @JsName("test2") fun `deserializing null in optional throws SerializationException`() { //language=json val json = """{ "value":null }""" @@ -46,7 +45,6 @@ internal class OptionalSnowflakeTest { class ValueOptionalEntity(val value: OptionalSnowflake = OptionalSnowflake.Missing) @Test - @JsName("test3") fun `deserializing value in optional assigns Value`() { //language=test val json = """{ "value":5 }""" diff --git a/common/src/commonTest/kotlin/entity/optional/OptionalTest.kt b/common/src/commonTest/kotlin/entity/optional/OptionalTest.kt index 25879bfaff6..b74ffcc0d64 100644 --- a/common/src/commonTest/kotlin/entity/optional/OptionalTest.kt +++ b/common/src/commonTest/kotlin/entity/optional/OptionalTest.kt @@ -2,9 +2,7 @@ package dev.kord.common.entity.optional import kotlinx.serialization.Serializable import kotlinx.serialization.SerializationException -import kotlinx.serialization.decodeFromString import kotlinx.serialization.json.Json -import kotlin.js.JsName import kotlin.test.Test import kotlin.test.assertEquals import kotlin.test.assertFailsWith @@ -13,7 +11,6 @@ import kotlin.test.assertIs internal class OptionalTest { @Test - @JsName("test1") fun `creating optional from nullable value returns Value on non-null value`() { val value = 5 val optional = Optional(value) @@ -23,7 +20,6 @@ internal class OptionalTest { } @Test - @JsName("test2") fun `creating optional from nullable value returns Null on null value`() { val value: Int? = null val optional = Optional(value) @@ -36,7 +32,6 @@ internal class OptionalTest { private class NullOptionalEntity(val value: Optional = Optional.Missing()) @Test - @JsName("test3") fun `deserializing null in nullable optional assigns Null`() { //language=json val json = """{ "value":null }""" @@ -51,7 +46,6 @@ internal class OptionalTest { class EmptyOptionalEntity(val value: Optional = Optional.Missing()) @Test - @JsName("test4") fun `deserializing nothing in nullable optional assigns Missing`() { //language=json val json = """{}""" @@ -66,7 +60,6 @@ internal class OptionalTest { class UnexpectedEmptyOptionalEntity(val value: Optional = Optional.Missing()) @Test - @JsName("test5") fun `deserializing nothing in non-nullable optional assigns Missing`() { //language=json val json = """{}""" @@ -81,7 +74,6 @@ internal class OptionalTest { private class UnexpectedNullOptionalEntity(@Suppress("unused") val value: Optional = Optional.Missing()) @Test - @JsName("test6") fun `deserializing null in non-nullable optional throws SerializationException`() { //language=json val json = """{ "value":null }""" diff --git a/common/src/commonTest/kotlin/json/ChannelTest.kt b/common/src/commonTest/kotlin/json/ChannelTest.kt index 9851007c24d..6ed862b7f51 100644 --- a/common/src/commonTest/kotlin/json/ChannelTest.kt +++ b/common/src/commonTest/kotlin/json/ChannelTest.kt @@ -5,16 +5,14 @@ import dev.kord.common.entity.optional.value import dev.kord.common.readFile import kotlinx.coroutines.test.runTest import kotlinx.serialization.json.Json -import kotlin.js.JsName -import kotlin.time.Duration.Companion.seconds import kotlin.test.Test +import kotlin.time.Duration.Companion.seconds private suspend fun file(name: String): String = readFile("channel", name) class ChannelTest { @Test - @JsName("test1") fun `DMChannel serialization`() = runTest { val channel = Json.decodeFromString(DiscordChannel.serializer(), file("dmchannel")) @@ -36,7 +34,6 @@ class ChannelTest { @Test - @JsName("test2") fun `ChannelCategory serialization`() = runTest { val channel = Json.decodeFromString(DiscordChannel.serializer(), file("channelcategory")) @@ -53,7 +50,6 @@ class ChannelTest { @Test - @JsName("test3") fun `GroupDMChannel serialization`() = runTest { val channel = Json.decodeFromString(DiscordChannel.serializer(), file("groupdmchannel")) @@ -84,7 +80,6 @@ class ChannelTest { @Test - @JsName("test4") fun `GuildNewChannel serialization`() = runTest { val channel = Json.decodeFromString(DiscordChannel.serializer(), file("guildnewschannel")) @@ -104,7 +99,6 @@ class ChannelTest { @Test - @JsName("test5") fun `GuildTextChannel serialization`() = runTest { val channel = Json.decodeFromString(DiscordChannel.serializer(), file("guildtextchannel")) @@ -125,7 +119,6 @@ class ChannelTest { @Test - @JsName("test6") fun `GuildVoiceChannel serialization`() = runTest { val channel = Json.decodeFromString(DiscordChannel.serializer(), file("guildvoicechannel")) diff --git a/common/src/commonTest/kotlin/json/EmojiTest.kt b/common/src/commonTest/kotlin/json/EmojiTest.kt index 7af78e1c6ef..ea84f65be6f 100644 --- a/common/src/commonTest/kotlin/json/EmojiTest.kt +++ b/common/src/commonTest/kotlin/json/EmojiTest.kt @@ -5,7 +5,6 @@ import dev.kord.common.entity.Snowflake import dev.kord.common.readFile import kotlinx.coroutines.test.runTest import kotlinx.serialization.json.Json -import kotlin.js.JsName import kotlin.test.Test private suspend fun file(name: String): String = readFile("emoji", name) @@ -13,7 +12,6 @@ private suspend fun file(name: String): String = readFile("emoji", name) class EmojiTest { @Test - @JsName("test1") fun `Custom Emoji serialization`() = runTest { val emoji = Json.decodeFromString(DiscordEmoji.serializer(), file("customemoji")) @@ -24,7 +22,6 @@ class EmojiTest { } @Test - @JsName("test2") fun `Standard Emoji serialization`() = runTest { val emoji = Json.decodeFromString(DiscordEmoji.serializer(), file("standardemoji")) @@ -35,7 +32,6 @@ class EmojiTest { } @Test - @JsName("test3") fun `Emoji serialization`() = runTest { val emoji = Json.decodeFromString(DiscordEmoji.serializer(), file("emoji")) diff --git a/common/src/commonTest/kotlin/json/GuildTest.kt b/common/src/commonTest/kotlin/json/GuildTest.kt index 93549a01ca0..04b3cd56560 100644 --- a/common/src/commonTest/kotlin/json/GuildTest.kt +++ b/common/src/commonTest/kotlin/json/GuildTest.kt @@ -6,7 +6,6 @@ import dev.kord.common.readFile import kotlinx.coroutines.test.runTest import kotlinx.datetime.Instant import kotlinx.serialization.json.Json -import kotlin.js.JsName import kotlin.test.Test import kotlin.time.Duration.Companion.seconds @@ -15,7 +14,6 @@ private suspend fun file(name: String): String = readFile("guild", name) class GuildTest { @Test - @JsName("test1") fun `Guild serialization`() = runTest { val guild = Json.decodeFromString(DiscordGuild.serializer(), file("guild")) @@ -68,7 +66,6 @@ class GuildTest { } @Test - @JsName("test2") fun `UnavailableGuild serialization`() = runTest { val guild = Json.decodeFromString(DiscordUnavailableGuild.serializer(), file("unavailableguild")) @@ -80,7 +77,6 @@ class GuildTest { } @Test - @JsName("test3") fun `GuildMember serialization`() = runTest { val member = Json.decodeFromString(DiscordGuildMember.serializer(), file("guildmember")) @@ -95,7 +91,6 @@ class GuildTest { } @Test - @JsName("test4") fun `PartialGuild serialization`() = runTest { val guild = Json.decodeFromString(DiscordPartialGuild.serializer(), file("partialguild")) diff --git a/common/src/commonTest/kotlin/json/InteractionTest.kt b/common/src/commonTest/kotlin/json/InteractionTest.kt index eaf6bb6aa79..1b402c64ff1 100644 --- a/common/src/commonTest/kotlin/json/InteractionTest.kt +++ b/common/src/commonTest/kotlin/json/InteractionTest.kt @@ -6,7 +6,6 @@ import dev.kord.common.entity.optional.orEmpty import dev.kord.common.readFile import kotlinx.coroutines.test.runTest import kotlinx.serialization.json.Json -import kotlin.js.JsName import kotlin.test.Test import kotlin.test.assertIs @@ -37,7 +36,6 @@ class InteractionTest { } @Test - @JsName("test1") fun `group command can be deserialized`() = runTest { val text = file("groupsubcommand") @@ -66,7 +64,6 @@ class InteractionTest { } @Test - @JsName("test2") fun `subcommand can be deserialized`() = runTest { val text = file("subcommand") @@ -94,7 +91,6 @@ class InteractionTest { @Test - @JsName("test3") fun `root can be deserialized`() = runTest { val text = file("rootcommand") @@ -119,7 +115,6 @@ class InteractionTest { } @Test - @JsName("test4") fun `slash command permissions can be serialized`() = runTest { val text = file("slash_command_permissions_update") @@ -139,7 +134,6 @@ class InteractionTest { } @Test - @JsName("test5") fun `select menu can be deserialized`() = runTest { val text = file("selectmenu") diff --git a/common/src/commonTest/kotlin/json/MessageTest.kt b/common/src/commonTest/kotlin/json/MessageTest.kt index 2b4332166de..036149029e6 100644 --- a/common/src/commonTest/kotlin/json/MessageTest.kt +++ b/common/src/commonTest/kotlin/json/MessageTest.kt @@ -1,11 +1,12 @@ package dev.kord.common.json -import dev.kord.common.entity.* +import dev.kord.common.entity.DiscordMessage +import dev.kord.common.entity.MessageFlag +import dev.kord.common.entity.MessageFlags import dev.kord.common.readFile import kotlinx.coroutines.test.runTest import kotlinx.datetime.Instant import kotlinx.serialization.json.Json -import kotlin.js.JsName import kotlin.test.Test private suspend fun file(name: String): String = readFile("message", name) @@ -13,7 +14,6 @@ private suspend fun file(name: String): String = readFile("message", name) class MessageTest { @Test - @JsName("test1") fun `Message serialization`() = runTest { val message: DiscordMessage = Json.decodeFromString(DiscordMessage.serializer(), file("message")) @@ -52,7 +52,6 @@ class MessageTest { } @Test - @JsName("test2") fun `User serialization`() = runTest { val message = Json.decodeFromString(DiscordMessage.serializer(), file("crossposted")) diff --git a/common/src/commonTest/kotlin/json/PermissionsTest.kt b/common/src/commonTest/kotlin/json/PermissionsTest.kt index 291985a2aec..6c45b7c794c 100644 --- a/common/src/commonTest/kotlin/json/PermissionsTest.kt +++ b/common/src/commonTest/kotlin/json/PermissionsTest.kt @@ -6,14 +6,12 @@ import dev.kord.common.entity.Permissions import kotlinx.serialization.json.Json import kotlinx.serialization.json.buildJsonObject import kotlinx.serialization.json.put -import kotlin.js.JsName import kotlin.test.Test import kotlin.test.assertEquals class PermissionsTest { @Test - @JsName("test1") fun `adding permissions together does not swallow the universe`() { Permission.entries.fold(Permissions()) { acc, permission -> acc + permission @@ -21,7 +19,6 @@ class PermissionsTest { } @Test - @JsName("test3") fun `permissions serialization test`() { val expected = buildJsonObject { put("id", "12323232") diff --git a/common/src/commonTest/kotlin/json/UserTest.kt b/common/src/commonTest/kotlin/json/UserTest.kt index 4b1fc18877a..6d128f05048 100644 --- a/common/src/commonTest/kotlin/json/UserTest.kt +++ b/common/src/commonTest/kotlin/json/UserTest.kt @@ -6,7 +6,6 @@ import dev.kord.common.entity.UserFlags import dev.kord.common.readFile import kotlinx.coroutines.test.runTest import kotlinx.serialization.json.Json -import kotlin.js.JsName import kotlin.test.Test private suspend fun file(name: String): String = readFile("user", name) @@ -14,7 +13,6 @@ private suspend fun file(name: String): String = readFile("user", name) class UserTest { @Test - @JsName("test1") fun `User serialization`() = runTest { val user = Json.decodeFromString(DiscordUser.serializer(), file("user")) diff --git a/common/src/commonTest/kotlin/json/VoiceStateTest.kt b/common/src/commonTest/kotlin/json/VoiceStateTest.kt index 1d73de02faf..17b1409e417 100644 --- a/common/src/commonTest/kotlin/json/VoiceStateTest.kt +++ b/common/src/commonTest/kotlin/json/VoiceStateTest.kt @@ -5,7 +5,6 @@ import dev.kord.common.readFile import kotlinx.coroutines.test.runTest import kotlinx.datetime.Instant import kotlinx.serialization.json.Json -import kotlin.js.JsName import kotlin.test.Test private suspend fun file(name: String): String = readFile("voice", name) @@ -13,7 +12,6 @@ private suspend fun file(name: String): String = readFile("voice", name) class VoiceStateTest { @Test - @JsName("test1") fun `VoiceState serialization`() = runTest { val state = Json.decodeFromString(DiscordVoiceState.serializer(), file("voicestate")) diff --git a/common/src/commonTest/kotlin/ratelimit/AbstractIntervalRateLimiterTest.kt b/common/src/commonTest/kotlin/ratelimit/AbstractIntervalRateLimiterTest.kt index 2a47a2cf732..454eb90dbde 100644 --- a/common/src/commonTest/kotlin/ratelimit/AbstractIntervalRateLimiterTest.kt +++ b/common/src/commonTest/kotlin/ratelimit/AbstractIntervalRateLimiterTest.kt @@ -2,7 +2,6 @@ package dev.kord.common.ratelimit import kotlinx.coroutines.test.currentTime import kotlinx.coroutines.test.runTest -import kotlin.js.JsName import kotlin.test.BeforeTest import kotlin.test.Test import kotlin.test.assertEquals @@ -27,7 +26,6 @@ abstract class AbstractIntervalRateLimiterTest { } @Test - @JsName("test1") fun `an interval rate limiter does not accept illegal arguments`() { fun assertIAE(limit: Int, interval: Duration) { @@ -42,7 +40,6 @@ abstract class AbstractIntervalRateLimiterTest { } @Test - @JsName("test2") fun `an interval rate limiter does not ratelimit when under limit`() = runTest { repeat(limit) { rateLimiter.consume() } @@ -50,7 +47,6 @@ abstract class AbstractIntervalRateLimiterTest { } @Test - @JsName("test3") fun `an interval rate limiter does ratelimit when over limit`() = runTest { repeat(limit + 1) { rateLimiter.consume() } diff --git a/common/src/commonTest/kotlin/serialization/DurationSerializersTests.kt b/common/src/commonTest/kotlin/serialization/DurationSerializersTests.kt index 438ae90955b..c0148f03a45 100644 --- a/common/src/commonTest/kotlin/serialization/DurationSerializersTests.kt +++ b/common/src/commonTest/kotlin/serialization/DurationSerializersTests.kt @@ -2,7 +2,6 @@ package dev.kord.common.serialization import kotlinx.serialization.SerializationException import kotlinx.serialization.json.Json -import kotlin.js.JsName import kotlin.test.Test import kotlin.test.assertEquals import kotlin.test.assertFailsWith @@ -43,20 +42,17 @@ abstract class DurationAsLongSerializerTest( @Test - @JsName("test1") fun `zero Duration can be serialized`() { assertEquals(expected = "0", actual = serialize(Duration.ZERO)) } @Test - @JsName("test2") fun `zero Duration can be deserialized`() { assertEquals(expected = Duration.ZERO, actual = deserialize("0")) } @Test - @JsName("test3") fun `infinite Durations cannot be serialized`() { assertFailsWith { serialize(Duration.INFINITE) } assertFailsWith { serialize(-Duration.INFINITE) } @@ -64,45 +60,38 @@ abstract class DurationAsLongSerializerTest( @Test - @JsName("test4") fun `positive Duration can be serialized`() { assertEquals(expected = json, actual = serialize(duration)) } @Test - @JsName("test5") fun `positive Duration can be rounded and serialized`() { assertEquals(expected = json, actual = serialize(durationToRound)) } @Test - @JsName("test6") fun `positive Duration can be deserialized`() { assertEquals(expected = duration, actual = deserialize(json)) } @Test - @JsName("test7") fun `negative Duration can be serialized`() { assertEquals(expected = "-$json", actual = serialize(-duration)) } @Test - @JsName("test8") fun `negative Duration can be rounded and serialized`() { assertEquals(expected = "-$json", actual = serialize(-durationToRound)) } @Test - @JsName("test9") fun `negative Duration can be deserialized`() { assertEquals(expected = -duration, actual = deserialize("-$json")) } @Test - @JsName("test10") fun `positive Duration that would overflow in target unit cannot be serialized`() { if (durationThatWouldOverflowInTargetUnit != null) assertFailsWith { serialize(durationThatWouldOverflowInTargetUnit) @@ -110,7 +99,6 @@ abstract class DurationAsLongSerializerTest( } @Test - @JsName("test11") fun `negative Duration that would overflow in target unit cannot be serialized`() { if (durationThatWouldOverflowInTargetUnit != null) assertFailsWith { serialize(-durationThatWouldOverflowInTargetUnit) @@ -119,13 +107,11 @@ abstract class DurationAsLongSerializerTest( @Test - @JsName("test12") fun `large positive Duration gets deserialized as Infinity`() { if (largeJson != null) assertEquals(expected = Duration.INFINITE, deserialize(largeJson)) } @Test - @JsName("test13") fun `large negative Duration gets deserialized as -Infinity`() { if (largeJson != null) assertEquals(expected = -Duration.INFINITE, deserialize("-$largeJson")) } diff --git a/common/src/commonTest/kotlin/serialization/InstantSerializersTests.kt b/common/src/commonTest/kotlin/serialization/InstantSerializersTests.kt index d03fe60f98c..ee1a8348ef0 100644 --- a/common/src/commonTest/kotlin/serialization/InstantSerializersTests.kt +++ b/common/src/commonTest/kotlin/serialization/InstantSerializersTests.kt @@ -4,7 +4,6 @@ import kotlinx.datetime.Instant import kotlinx.serialization.KSerializer import kotlinx.serialization.SerializationException import kotlinx.serialization.json.Json -import kotlin.js.JsName import kotlin.test.Test import kotlin.test.assertEquals import kotlin.test.assertFailsWith @@ -28,39 +27,33 @@ abstract class InstantSerializerTest( @Test - @JsName("test1") fun `epoch Instant can be serialized`() { assertEquals(expected = "0", actual = serialize(EPOCH)) } @Test - @JsName("test2") fun `epoch Instant can be deserialized`() { assertEquals(expected = EPOCH, actual = deserialize("0")) } @Test - @JsName("test3") fun `future Instant can be serialized`() { assertEquals(expected = json, actual = serialize(instant)) } @Test - @JsName("test4") fun `future Instant can be deserialized`() { assertEquals(expected = instant, actual = deserialize(json)) } @Test - @JsName("test5") fun `past Instant can be serialized`() { assertEquals(expected = "-$json", actual = serialize(mirroredInstant)) } @Test - @JsName("test6") fun `past Instant can be deserialized`() { assertEquals(expected = mirroredInstant, actual = deserialize("-$json")) } @@ -83,7 +76,6 @@ class InstantInEpochMillisecondsSerializerTest : InstantSerializerTest( private val clampedMax = Instant.fromEpochSeconds(Long.MAX_VALUE, Long.MAX_VALUE).toEpochMilliseconds() @Test - @JsName("test7") fun `future Instant under limit can be serialized`() { assertEquals( expected = (if (futureClamped) clampedMax else Long.MAX_VALUE - 1).toString(), @@ -92,7 +84,6 @@ class InstantInEpochMillisecondsSerializerTest : InstantSerializerTest( } @Test - @JsName("test8") fun `past Instant under limit can be serialized`() { assertEquals( expected = (if (pastClamped) clampedMin else Long.MIN_VALUE).toString(), @@ -102,7 +93,6 @@ class InstantInEpochMillisecondsSerializerTest : InstantSerializerTest( @Test - @JsName("test9") fun `future Instant exactly at limit can be serialized`() { assertEquals( expected = (if (futureClamped) clampedMax else Long.MAX_VALUE).toString(), @@ -111,7 +101,6 @@ class InstantInEpochMillisecondsSerializerTest : InstantSerializerTest( } @Test - @JsName("test10") fun `past Instant exactly at limit can be serialized`() { assertEquals( expected = (if (pastClamped) clampedMin else Long.MIN_VALUE).toString(), @@ -121,13 +110,11 @@ class InstantInEpochMillisecondsSerializerTest : InstantSerializerTest( @Test - @JsName("test11") fun `future Instant over limit cannot be serialized`() { if (!futureClamped) assertFailsWith { serialize(future + 1.nanoseconds) } } @Test - @JsName("test12") fun `past Instant over limit cannot be serialized`() { if (!pastClamped) assertFailsWith { serialize(past - 1.nanoseconds) } } diff --git a/core/live-tests/src/commonTest/kotlin/KordTest.kt b/core/live-tests/src/commonTest/kotlin/KordTest.kt index c91db63b330..175b216c64d 100644 --- a/core/live-tests/src/commonTest/kotlin/KordTest.kt +++ b/core/live-tests/src/commonTest/kotlin/KordTest.kt @@ -2,13 +2,11 @@ package dev.kord.core import dev.kord.core.event.gateway.ReadyEvent import kotlinx.coroutines.test.runTest -import kotlin.js.JsName import kotlin.test.Test import kotlin.test.assertFalse internal class KordTest { @Test - @JsName("test1") fun `Kord life cycle is correctly ended on shutdown`() = runTest { val kord = Kord.restOnly(testToken) val job = kord.on {} diff --git a/core/live-tests/src/commonTest/kotlin/StrategyTest.kt b/core/live-tests/src/commonTest/kotlin/StrategyTest.kt index d7c0a9837ff..168c3ba748b 100644 --- a/core/live-tests/src/commonTest/kotlin/StrategyTest.kt +++ b/core/live-tests/src/commonTest/kotlin/StrategyTest.kt @@ -3,7 +3,6 @@ package dev.kord.core import dev.kord.cache.api.put import dev.kord.core.supplier.EntitySupplyStrategy import kotlinx.coroutines.test.runTest -import kotlin.js.JsName import kotlin.test.Test import kotlin.test.assertEquals import kotlin.test.assertNotNull @@ -12,7 +11,6 @@ import kotlin.test.assertNull class StrategyTest { @Test - @JsName("test1") fun `rest only`() = runTest { withKord { kord -> val fromRest = kord.with(EntitySupplyStrategy.rest).getSelfOrNull() @@ -23,7 +21,6 @@ class StrategyTest { } @Test - @JsName("test2") fun `cache only`() = runTest { withKord { kord -> kord.cache.put(kord.getSelf().data) @@ -33,7 +30,6 @@ class StrategyTest { } @Test - @JsName("test3") fun `cache falls back to rest`() = runTest { withKord { kord -> val cache = kord.with(EntitySupplyStrategy.cache) diff --git a/core/live-tests/src/commonTest/kotlin/regression/CacheMissRegression.kt b/core/live-tests/src/commonTest/kotlin/regression/CacheMissRegression.kt index ae948c06fbb..2f9ecc3fd5a 100644 --- a/core/live-tests/src/commonTest/kotlin/regression/CacheMissRegression.kt +++ b/core/live-tests/src/commonTest/kotlin/regression/CacheMissRegression.kt @@ -31,7 +31,6 @@ import kotlinx.serialization.SerializationStrategy import kotlinx.serialization.json.Json import kotlin.coroutines.CoroutineContext import kotlin.coroutines.EmptyCoroutineContext -import kotlin.js.JsName import kotlin.test.Test import kotlin.test.assertFailsWith import kotlin.time.Duration @@ -106,7 +105,6 @@ class CrashingHandler(private val client: HttpClient, override val token: String class CacheMissingRegressions { @Test - @JsName("test1") fun `if data not in cache explode`() = runTest { withKord { kord -> val id = 5uL @@ -115,7 +113,6 @@ class CacheMissingRegressions { } @Test - @JsName("test2") fun `if data in cache don't fetch from rest`() = runTest { withKord { kord -> val id = Snowflake(5uL) diff --git a/core/src/commonTest/kotlin/UtilKtTest.kt b/core/src/commonTest/kotlin/UtilKtTest.kt index bebabae722a..3eb7df59722 100644 --- a/core/src/commonTest/kotlin/UtilKtTest.kt +++ b/core/src/commonTest/kotlin/UtilKtTest.kt @@ -3,14 +3,12 @@ package dev.kord.core import dev.kord.common.entity.Snowflake import kotlinx.coroutines.flow.count import kotlinx.coroutines.test.runTest -import kotlin.js.JsName import kotlin.test.Test import kotlin.test.assertEquals internal class UtilKtTest { @Test - @JsName("test1") fun `paginate forwards selects the right id`() = runTest { val flow = paginateForwards(start = Snowflake(0u), batchSize = 100, idSelector = { it }) { @@ -29,7 +27,6 @@ internal class UtilKtTest { } @Test - @JsName("test2") fun `paginate backwards selects the right id`() = runTest { val flow = paginateBackwards(start = Snowflake(1000u), batchSize = 100, idSelector = { it }) { diff --git a/core/src/commonTest/kotlin/cache/data/ComponentDataTest.kt b/core/src/commonTest/kotlin/cache/data/ComponentDataTest.kt index ec9b840f884..8bb6334668c 100644 --- a/core/src/commonTest/kotlin/cache/data/ComponentDataTest.kt +++ b/core/src/commonTest/kotlin/cache/data/ComponentDataTest.kt @@ -3,14 +3,12 @@ package dev.kord.core.cache.data import dev.kord.common.entity.ComponentType import kotlinx.serialization.encodeToString import kotlinx.serialization.json.Json -import kotlin.js.JsName import kotlin.test.Test import kotlin.test.assertEquals class ComponentDataTest { @Test - @JsName("test1") fun `polymorphic ComponentData can be serialized`() { val type = ComponentType.ActionRow val data: ComponentData = ChatComponentData(type) diff --git a/core/src/commonTest/kotlin/gateway/MasterGatewayTest.kt b/core/src/commonTest/kotlin/gateway/MasterGatewayTest.kt index ed4e3f5405b..5303e8659e8 100644 --- a/core/src/commonTest/kotlin/gateway/MasterGatewayTest.kt +++ b/core/src/commonTest/kotlin/gateway/MasterGatewayTest.kt @@ -9,7 +9,6 @@ import kotlinx.coroutines.flow.MutableStateFlow import kotlinx.coroutines.flow.SharedFlow import kotlin.coroutines.CoroutineContext import kotlin.coroutines.EmptyCoroutineContext -import kotlin.js.JsName import kotlin.test.Test import kotlin.test.assertEquals import kotlin.time.Duration @@ -18,7 +17,6 @@ import kotlin.time.Duration.Companion.milliseconds internal class DefaultMasterGatewayTest { @Test - @JsName("test1") fun `Gateway takes ping of single child`() { val dummy = DummyGateway() val ping = 150.milliseconds @@ -33,7 +31,6 @@ internal class DefaultMasterGatewayTest { } @Test - @JsName("test2") fun `Gateway takes ping average of multiple children`() { val dummy1 = DummyGateway() val dummy2 = DummyGateway() @@ -51,7 +48,6 @@ internal class DefaultMasterGatewayTest { } @Test - @JsName("test3") fun `Gateway returns null ping when no gateway pings`(){ val dummy = DummyGateway() diff --git a/core/src/commonTest/kotlin/live/LiveGuildTest.kt b/core/src/commonTest/kotlin/live/LiveGuildTest.kt index ac205b5426c..7ca89f5b43b 100644 --- a/core/src/commonTest/kotlin/live/LiveGuildTest.kt +++ b/core/src/commonTest/kotlin/live/LiveGuildTest.kt @@ -14,7 +14,6 @@ import kotlinx.coroutines.job import kotlinx.coroutines.test.runTest import kotlinx.datetime.Instant import kotlinx.serialization.json.JsonObject -import kotlin.js.JsName import kotlin.test.BeforeTest import kotlin.test.Ignore import kotlin.test.Test @@ -54,7 +53,6 @@ class LiveGuildTest : AbstractLiveEntityTest() { } @Test - @JsName("test1") fun `Check onEmojisUpdate is called when event is received`() { countdownContext(1) { live.onEmojisUpdate { @@ -75,7 +73,6 @@ class LiveGuildTest : AbstractLiveEntityTest() { } @Test - @JsName("test2") fun `Check onIntegrationsUpdate is called when event is received`() { countdownContext(1) { live.onIntegrationsUpdate { @@ -95,7 +92,6 @@ class LiveGuildTest : AbstractLiveEntityTest() { } @Test - @JsName("test3") fun `Check onBanAdd is called when event is received`() { countdownContext(1) { live.onBanAdd { @@ -120,7 +116,6 @@ class LiveGuildTest : AbstractLiveEntityTest() { } @Test - @JsName("test4") fun `Check onBanRemove is called when event is received`() { countdownContext(1) { live.onBanRemove { @@ -145,7 +140,6 @@ class LiveGuildTest : AbstractLiveEntityTest() { } @Test - @JsName("test5") fun `Check onPresenceUpdate is called when event is received`() { countdownContext(1) { live.onPresenceUpdate { @@ -172,7 +166,6 @@ class LiveGuildTest : AbstractLiveEntityTest() { } @Test - @JsName("test6") fun `Check onVoiceServerUpdate is called when event is received`() { countdownContext(1) { live.onVoiceServerUpdate { @@ -194,7 +187,6 @@ class LiveGuildTest : AbstractLiveEntityTest() { } @Test - @JsName("test7") fun `Check onVoiceStateUpdate is called when event is received`() { countdownContext(1) { live.onVoiceStateUpdate { @@ -224,7 +216,6 @@ class LiveGuildTest : AbstractLiveEntityTest() { } @Test - @JsName("test8") fun `Check onWebhookUpdate is called when event is received`() { countdownContext(1) { live.onWebhookUpdate { @@ -245,7 +236,6 @@ class LiveGuildTest : AbstractLiveEntityTest() { } @Test - @JsName("test9") fun `Check onRoleCreate is called when event is received`() { countdownContext(1) { live.onRoleCreate { @@ -278,7 +268,6 @@ class LiveGuildTest : AbstractLiveEntityTest() { } @Test - @JsName("test10") fun `Check onRoleUpdate is called when event is received`() { countdownContext(1) { live.onRoleUpdate { @@ -311,7 +300,6 @@ class LiveGuildTest : AbstractLiveEntityTest() { } @Test - @JsName("test11") fun `Check onRoleDelete is called when event is received`() { countdownContext(1) { live.onRoleDelete { @@ -332,7 +320,6 @@ class LiveGuildTest : AbstractLiveEntityTest() { } @Test - @JsName("test12") fun `Check onMemberJoin is called when event is received`() { countdownContext(1) { live.onMemberJoin { @@ -364,7 +351,6 @@ class LiveGuildTest : AbstractLiveEntityTest() { } @Test - @JsName("test13") fun `Check onMemberUpdate is called when event is received`() { countdownContext(1) { live.onMemberUpdate { @@ -392,7 +378,6 @@ class LiveGuildTest : AbstractLiveEntityTest() { } @Test - @JsName("test14") fun `Check onMemberLeave is called when event is received`() { countdownContext(1) { live.onMemberLeave { @@ -417,7 +402,6 @@ class LiveGuildTest : AbstractLiveEntityTest() { } @Test - @JsName("test15") fun `Check onReactionAdd is called when event is received`() { countdownContext(1) { val emojiExpected = ReactionEmoji.Unicode("\uD83D\uDC28") @@ -443,7 +427,6 @@ class LiveGuildTest : AbstractLiveEntityTest() { } @Test - @JsName("test16") fun `Check onReactionAdd with specific reaction is called when event is received`() { countdownContext(1) { val emojiExpected = ReactionEmoji.Unicode("\uD83D\uDC28") @@ -473,7 +456,6 @@ class LiveGuildTest : AbstractLiveEntityTest() { } @Test - @JsName("test17") fun `Check onReactionRemove is called when event is received`() { countdownContext(1) { val emojiExpected = ReactionEmoji.Unicode("\uD83D\uDC28") @@ -500,7 +482,6 @@ class LiveGuildTest : AbstractLiveEntityTest() { } @Test - @JsName("test18") fun `Check onReactionRemove with specific reaction is called when event is received`() { countdownContext(1) { val emojiExpected = ReactionEmoji.Unicode("\uD83D\uDC28") @@ -530,7 +511,6 @@ class LiveGuildTest : AbstractLiveEntityTest() { } @Test - @JsName("test19") fun `Check onReactionRemoveAll is called when event is received`() { countdownContext(1) { live.onReactionRemoveAll { @@ -552,7 +532,6 @@ class LiveGuildTest : AbstractLiveEntityTest() { } @Test - @JsName("test20") fun `Check onMessageCreate is called when event is received`() { countdownContext(1) { live.onMessageCreate { @@ -590,7 +569,6 @@ class LiveGuildTest : AbstractLiveEntityTest() { } @Test - @JsName("test21") fun `Check onMessageUpdate is called when event is received`() { countdownContext(1) { live.onMessageUpdate { @@ -612,7 +590,6 @@ class LiveGuildTest : AbstractLiveEntityTest() { } @Test - @JsName("test22") fun `Check onMessageDelete is called when event is received`() { countdownContext(1) { live.onMessageDelete { @@ -634,7 +611,6 @@ class LiveGuildTest : AbstractLiveEntityTest() { } @Test - @JsName("test23") fun `Check onChannelCreate is called when event is received`() { countdownContext(1) { live.onChannelCreate { @@ -656,7 +632,6 @@ class LiveGuildTest : AbstractLiveEntityTest() { } @Test - @JsName("test24") fun `Check onChannelUpdate is called when event is received`() { countdownContext(1) { live.onChannelUpdate { @@ -678,7 +653,6 @@ class LiveGuildTest : AbstractLiveEntityTest() { } @Test - @JsName("test25") fun `Check onChannelDelete is called when event is received`() { countdownContext(1) { live.onChannelDelete { @@ -700,7 +674,6 @@ class LiveGuildTest : AbstractLiveEntityTest() { } @Test - @JsName("test26") fun `Check onGuildCreate is called when event is received`() { countdownContext(1) { live.onGuildCreate { @@ -746,7 +719,6 @@ class LiveGuildTest : AbstractLiveEntityTest() { } @Test - @JsName("test27") fun `Check onGuildUpdate is called when event is received`() { countdownContext(1) { live.onGuildUpdate { @@ -792,7 +764,6 @@ class LiveGuildTest : AbstractLiveEntityTest() { } @Test - @JsName("test28") fun `Check if live entity is completed when event the guild delete event is received`() { countdownContext(1) { live.coroutineContext.job.invokeOnCompletion { diff --git a/core/src/commonTest/kotlin/live/LiveKordEntityTest.kt b/core/src/commonTest/kotlin/live/LiveKordEntityTest.kt index c5947684be9..11b5c08ab41 100644 --- a/core/src/commonTest/kotlin/live/LiveKordEntityTest.kt +++ b/core/src/commonTest/kotlin/live/LiveKordEntityTest.kt @@ -16,7 +16,6 @@ import kotlinx.coroutines.delay import kotlinx.coroutines.isActive import kotlinx.coroutines.job import kotlinx.coroutines.test.runTest -import kotlin.js.JsName import kotlin.test.* import kotlin.time.Duration.Companion.milliseconds @@ -56,7 +55,6 @@ class LiveKordEntityTest : AbstractLiveEntityTest { } assertTrue(job.isActive) @@ -75,7 +72,6 @@ class LiveKordEntityTest : AbstractLiveEntityTest { error("Never called") diff --git a/core/src/commonTest/kotlin/live/LiveMemberTest.kt b/core/src/commonTest/kotlin/live/LiveMemberTest.kt index 0ba1299e22b..9450975773d 100644 --- a/core/src/commonTest/kotlin/live/LiveMemberTest.kt +++ b/core/src/commonTest/kotlin/live/LiveMemberTest.kt @@ -17,7 +17,6 @@ import dev.kord.gateway.GuildMemberUpdate import kotlinx.coroutines.job import kotlinx.coroutines.test.runTest import kotlinx.datetime.Instant -import kotlin.js.JsName import kotlin.test.BeforeTest import kotlin.test.Ignore import kotlin.test.Test @@ -51,7 +50,6 @@ class LiveMemberTest : AbstractLiveEntityTest() { } @Test - @JsName("test1") fun `Check onUpdate is called when event is received`() { countdownContext(1) { live.onUpdate { @@ -79,7 +77,6 @@ class LiveMemberTest : AbstractLiveEntityTest() { } @Test - @JsName("test2") fun `Check onLeave is called when event is received`() { countdownContext(1) { live.coroutineContext.job.invokeOnCompletion { @@ -108,7 +105,6 @@ class LiveMemberTest : AbstractLiveEntityTest() { } @Test - @JsName("test3") fun `Check if live entity is completed when the member is banned`() { countdownContext(1) { live.coroutineContext.job.invokeOnCompletion { @@ -137,7 +133,6 @@ class LiveMemberTest : AbstractLiveEntityTest() { } @Test - @JsName("test4") fun `Check if live entity is completed when the guild is deleted`() { countdownContext(1) { live.coroutineContext.job.invokeOnCompletion { diff --git a/core/src/commonTest/kotlin/live/LiveMessageTest.kt b/core/src/commonTest/kotlin/live/LiveMessageTest.kt index 5efc131b8e6..aa0617d4de3 100644 --- a/core/src/commonTest/kotlin/live/LiveMessageTest.kt +++ b/core/src/commonTest/kotlin/live/LiveMessageTest.kt @@ -15,7 +15,6 @@ import dev.kord.gateway.* import kotlinx.coroutines.job import kotlinx.coroutines.test.runTest import kotlinx.datetime.Instant -import kotlin.js.JsName import kotlin.test.* @Ignore @@ -55,7 +54,6 @@ class LiveMessageTest : AbstractLiveEntityTest() { } @Test - @JsName("test1") fun `Check onReactionAdd is called when event is received`() { countdownContext(1) { val emojiExpected = ReactionEmoji.Unicode("\uD83D\uDC28") @@ -81,7 +79,6 @@ class LiveMessageTest : AbstractLiveEntityTest() { } @Test - @JsName("test2") fun `Check onReactionAdd with specific reaction is called when event is received`() { countdownContext(1) { val emojiExpected = ReactionEmoji.Unicode("\uD83D\uDC28") @@ -110,7 +107,6 @@ class LiveMessageTest : AbstractLiveEntityTest() { } @Test - @JsName("test3") fun `Check onReactionRemove is called when event is received`() { countdownContext(1) { val emojiExpected = ReactionEmoji.Unicode("\uD83D\uDC28") @@ -136,7 +132,6 @@ class LiveMessageTest : AbstractLiveEntityTest() { } @Test - @JsName("test4") fun `Check onReactionRemove with specific reaction is called when event is received`() { countdownContext(1) { val emojiExpected = ReactionEmoji.Unicode("\uD83D\uDC28") @@ -165,7 +160,6 @@ class LiveMessageTest : AbstractLiveEntityTest() { } @Test - @JsName("test5") fun `Check onReactionRemoveAll is called when event is received`() { countdownContext(1) { live.onReactionRemoveAll { @@ -186,7 +180,6 @@ class LiveMessageTest : AbstractLiveEntityTest() { } @Test - @JsName("test6") fun `Check onUpdate is called when event is received`() { countdownContext(1) { live.onUpdate { @@ -207,7 +200,6 @@ class LiveMessageTest : AbstractLiveEntityTest() { } @Test - @JsName("test7") fun `Check if live entity is completed when event the message delete event is received`() { countdownContext(1) { live.coroutineContext.job.invokeOnCompletion { @@ -232,7 +224,6 @@ class LiveMessageTest : AbstractLiveEntityTest() { } @Test - @JsName("test8") fun `Check if live entity is completed when event the bulk delete event is received`() { countdownContext(1) { live.coroutineContext.job.invokeOnCompletion { @@ -257,7 +248,6 @@ class LiveMessageTest : AbstractLiveEntityTest() { } @Test - @JsName("test9") fun `Check if live entity is completed when event the channel delete event is received`() { countdownContext(1) { live.coroutineContext.job.invokeOnCompletion { @@ -282,7 +272,6 @@ class LiveMessageTest : AbstractLiveEntityTest() { } @Test - @JsName("test10") fun `Check if live entity is completed when event the guild delete event is received`() { countdownContext(1) { live.coroutineContext.job.invokeOnCompletion { diff --git a/core/src/commonTest/kotlin/live/LiveRoleTest.kt b/core/src/commonTest/kotlin/live/LiveRoleTest.kt index bfecf840b59..868ed6ea08b 100644 --- a/core/src/commonTest/kotlin/live/LiveRoleTest.kt +++ b/core/src/commonTest/kotlin/live/LiveRoleTest.kt @@ -13,7 +13,6 @@ import dev.kord.gateway.GuildRoleDelete import dev.kord.gateway.GuildRoleUpdate import kotlinx.coroutines.job import kotlinx.coroutines.test.runTest -import kotlin.js.JsName import kotlin.test.BeforeTest import kotlin.test.Ignore import kotlin.test.Test @@ -49,7 +48,6 @@ class LiveRoleTest : AbstractLiveEntityTest() { } @Test - @JsName("test1") fun `Check onUpdate is called when event is received`() { countdownContext(1) { live.onUpdate { @@ -82,7 +80,6 @@ class LiveRoleTest : AbstractLiveEntityTest() { } @Test - @JsName("test2") fun `Check if live entity is completed when the role is deleted`() { countdownContext(1) { live.coroutineContext.job.invokeOnCompletion { @@ -107,7 +104,6 @@ class LiveRoleTest : AbstractLiveEntityTest() { } @Test - @JsName("test3") fun `Check if live entity is completed when the guild is deleted`() { countdownContext(1) { live.coroutineContext.job.invokeOnCompletion { diff --git a/core/src/commonTest/kotlin/live/LiveUserTest.kt b/core/src/commonTest/kotlin/live/LiveUserTest.kt index 9e39feb32d4..74f18948463 100644 --- a/core/src/commonTest/kotlin/live/LiveUserTest.kt +++ b/core/src/commonTest/kotlin/live/LiveUserTest.kt @@ -7,7 +7,6 @@ import dev.kord.core.entity.User import dev.kord.core.randomId import dev.kord.gateway.UserUpdate import kotlinx.coroutines.test.runTest -import kotlin.js.JsName import kotlin.test.BeforeTest import kotlin.test.Ignore import kotlin.test.Test @@ -32,7 +31,6 @@ class LiveUserTest : AbstractLiveEntityTest() { } @Test - @JsName("test1") fun `Check onUpdate is called when event is received`() { countdownContext(1) { live.onUpdate { diff --git a/core/src/commonTest/kotlin/live/channel/LiveCategoryTest.kt b/core/src/commonTest/kotlin/live/channel/LiveCategoryTest.kt index afbb9036f76..d174144168c 100644 --- a/core/src/commonTest/kotlin/live/channel/LiveCategoryTest.kt +++ b/core/src/commonTest/kotlin/live/channel/LiveCategoryTest.kt @@ -9,7 +9,6 @@ import dev.kord.core.entity.channel.Category import dev.kord.core.randomId import dev.kord.gateway.ChannelUpdate import kotlinx.coroutines.test.runTest -import kotlin.js.JsName import kotlin.test.BeforeTest import kotlin.test.Ignore import kotlin.test.Test @@ -35,7 +34,6 @@ class LiveCategoryTest : LiveChannelTest() { } @Test - @JsName("testOnUpdate") fun `Check onUpdate is called when event is received`() { countdownContext(1) { live.onUpdate { diff --git a/core/src/commonTest/kotlin/live/channel/LiveChannelTest.kt b/core/src/commonTest/kotlin/live/channel/LiveChannelTest.kt index 2fc1e617b04..3e422310f9c 100644 --- a/core/src/commonTest/kotlin/live/channel/LiveChannelTest.kt +++ b/core/src/commonTest/kotlin/live/channel/LiveChannelTest.kt @@ -15,7 +15,6 @@ import dev.kord.gateway.ChannelDelete import dev.kord.gateway.GuildDelete import kotlinx.coroutines.job import kotlinx.coroutines.test.runTest -import kotlin.js.JsName import kotlin.reflect.KClass import kotlin.test.Ignore import kotlin.test.Test @@ -27,7 +26,6 @@ abstract class LiveChannelTest : AbstractLiveEntityTest : AbstractLiveEntityTest : AbstractLiveEntityTest() { } @Test - @JsName("test31") fun `Check onUpdate is called when event is received`() { countdownContext(1) { live.onUpdate { diff --git a/core/src/commonTest/kotlin/live/channel/LiveGuildChannelTest.kt b/core/src/commonTest/kotlin/live/channel/LiveGuildChannelTest.kt index 1fe0e03905b..7a38d9c9fc3 100644 --- a/core/src/commonTest/kotlin/live/channel/LiveGuildChannelTest.kt +++ b/core/src/commonTest/kotlin/live/channel/LiveGuildChannelTest.kt @@ -12,7 +12,6 @@ import dev.kord.core.supplier.EntitySupplier import dev.kord.core.supplier.EntitySupplyStrategy import dev.kord.gateway.ChannelUpdate import kotlinx.coroutines.test.runTest -import kotlin.js.JsName import kotlin.test.BeforeTest import kotlin.test.Ignore import kotlin.test.Test @@ -48,7 +47,6 @@ class LiveGuildChannelTest : LiveChannelTest() { } @Test - @JsName("test11") fun `Check onUpdate is called when event is received`() { countdownContext(1) { live.onUpdate { diff --git a/core/src/commonTest/kotlin/live/channel/LiveGuildTextTest.kt b/core/src/commonTest/kotlin/live/channel/LiveGuildTextTest.kt index 5d34889f54c..d1f43e0e435 100644 --- a/core/src/commonTest/kotlin/live/channel/LiveGuildTextTest.kt +++ b/core/src/commonTest/kotlin/live/channel/LiveGuildTextTest.kt @@ -12,7 +12,6 @@ import dev.kord.core.supplier.EntitySupplier import dev.kord.core.supplier.EntitySupplyStrategy import dev.kord.gateway.ChannelUpdate import kotlinx.coroutines.test.runTest -import kotlin.js.JsName import kotlin.test.BeforeTest import kotlin.test.Ignore import kotlin.test.Test @@ -48,7 +47,6 @@ class LiveGuildTextTest : LiveChannelTest() { } @Test - @JsName("testOnUpdate") fun `Check onUpdate is called when event is received`() { countdownContext(1) { live.onUpdate { diff --git a/core/src/commonTest/kotlin/live/channel/LiveVoiceChannelTest.kt b/core/src/commonTest/kotlin/live/channel/LiveVoiceChannelTest.kt index 72b2913edc5..9e5668e1e20 100644 --- a/core/src/commonTest/kotlin/live/channel/LiveVoiceChannelTest.kt +++ b/core/src/commonTest/kotlin/live/channel/LiveVoiceChannelTest.kt @@ -9,7 +9,6 @@ import dev.kord.core.entity.channel.VoiceChannel import dev.kord.core.randomId import dev.kord.gateway.ChannelUpdate import kotlinx.coroutines.test.runTest -import kotlin.js.JsName import kotlin.test.BeforeTest import kotlin.test.Ignore import kotlin.test.Test @@ -35,7 +34,6 @@ class LiveVoiceChannelTest : LiveChannelTest() { } @Test - @JsName("test21") fun `Check onUpdate is called when event is received`() { countdownContext(1) { live.onUpdate { diff --git a/core/src/commonTest/kotlin/performance/KordEventDropTest.kt b/core/src/commonTest/kotlin/performance/KordEventDropTest.kt index 637a0fbe10d..a5c5db53e5b 100644 --- a/core/src/commonTest/kotlin/performance/KordEventDropTest.kt +++ b/core/src/commonTest/kotlin/performance/KordEventDropTest.kt @@ -26,7 +26,6 @@ import kotlinx.coroutines.test.runTest import kotlinx.datetime.Clock import kotlin.coroutines.CoroutineContext import kotlin.coroutines.EmptyCoroutineContext -import kotlin.js.JsName import kotlin.test.Test import kotlin.test.assertEquals import kotlin.time.Duration @@ -63,7 +62,6 @@ class KordEventDropTest { ) @Test - @JsName("test1") fun `hammering the gateway does not drop core events`() = runTest { val amount = 1_000 diff --git a/core/src/commonTest/kotlin/regression/ReactionEmojiTest.kt b/core/src/commonTest/kotlin/regression/ReactionEmojiTest.kt index c1c1c52f0b9..39dd8ba5957 100644 --- a/core/src/commonTest/kotlin/regression/ReactionEmojiTest.kt +++ b/core/src/commonTest/kotlin/regression/ReactionEmojiTest.kt @@ -2,13 +2,11 @@ package dev.kord.core.regression import dev.kord.common.entity.Snowflake import dev.kord.core.entity.ReactionEmoji -import kotlin.js.JsName import kotlin.test.Test class ReactionEmojiTest { @Test - @JsName("test1") fun `getting the id of a reaction emoji doesn't cause a castException`() { val emoji = ReactionEmoji.Custom(Snowflake(0u), "test", false) emoji.id diff --git a/core/src/commonTest/kotlin/supplier/CacheEntitySupplierTest.kt b/core/src/commonTest/kotlin/supplier/CacheEntitySupplierTest.kt index 5b54c6ffe54..0b95900fa89 100644 --- a/core/src/commonTest/kotlin/supplier/CacheEntitySupplierTest.kt +++ b/core/src/commonTest/kotlin/supplier/CacheEntitySupplierTest.kt @@ -16,14 +16,12 @@ import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.flow.MutableSharedFlow import kotlinx.coroutines.flow.toList import kotlinx.coroutines.test.runTest -import kotlin.js.JsName import kotlin.test.Test internal class CacheEntitySupplierTest { @Test @OptIn(KordUnsafe::class) - @JsName("test1") fun `cache does not throw when accessing unregistered entities`() = runTest { val kord = Kord( ClientResources("", Snowflake(0u), Shards(0), maxConcurrency = 1, HttpClient(), EntitySupplyStrategy.cache), diff --git a/gateway/src/commonTest/kotlin/DefaultGatewayTest.kt b/gateway/src/commonTest/kotlin/DefaultGatewayTest.kt index 9aa0749a197..b0e40cc522e 100644 --- a/gateway/src/commonTest/kotlin/DefaultGatewayTest.kt +++ b/gateway/src/commonTest/kotlin/DefaultGatewayTest.kt @@ -14,7 +14,6 @@ import kotlinx.coroutines.flow.flowOn import kotlinx.coroutines.flow.launchIn import kotlinx.coroutines.flow.onEach import kotlinx.coroutines.test.runTest -import kotlin.js.JsName import kotlin.test.Ignore import kotlin.test.Test import kotlin.time.Duration.Companion.seconds @@ -22,7 +21,6 @@ import kotlin.time.Duration.Companion.seconds class DefaultGatewayTest { @OptIn(DelicateCoroutinesApi::class) @Test - @JsName("test1") @Ignore fun `default gateway functions correctly`() = runTest { val token = getEnv("KORD_TEST_TOKEN") ?: error("Missing env variable KORD_TEST_TOKEN") diff --git a/gateway/src/commonTest/kotlin/json/CommandTest.kt b/gateway/src/commonTest/kotlin/json/CommandTest.kt index ffb1174f0c7..50fdfdfb796 100644 --- a/gateway/src/commonTest/kotlin/json/CommandTest.kt +++ b/gateway/src/commonTest/kotlin/json/CommandTest.kt @@ -11,7 +11,6 @@ import dev.kord.common.entity.optional.optionalInt import dev.kord.gateway.* import kotlinx.datetime.Instant import kotlinx.serialization.json.* -import kotlin.js.JsName import kotlin.test.Test import kotlin.test.assertEquals @@ -19,7 +18,6 @@ private val json = Json { encodeDefaults = false } class CommandTest { @Test - @JsName("test1") fun `Resume command serialization`() { val token = "token" val sessionId = "session" @@ -41,7 +39,6 @@ class CommandTest { @Test - @JsName("test2") fun `Heartbeat command serialization`() { val interval = 1337 @@ -57,7 +54,6 @@ class CommandTest { @Test - @JsName("test3") @OptIn(PrivilegedIntent::class) fun `RequestGuildMembers command serialization`() { val guildId = "1337" @@ -83,7 +79,6 @@ class CommandTest { @Test - @JsName("test4") fun `UpdateVoiceState command serialization`() { val guildId = "1337" val channelId = "420" @@ -110,7 +105,6 @@ class CommandTest { @Test - @JsName("test5") fun `UpdateState command serialization`() { val since = 1242518400L val activities = listOf() @@ -138,7 +132,6 @@ class CommandTest { @OptIn(PrivilegedIntent::class) @Test - @JsName("test6") fun `Identify command serialization`() { val token = "test" val properties = IdentifyProperties("os", "browser", "device") diff --git a/gateway/src/commonTest/kotlin/json/RegressionTests.kt b/gateway/src/commonTest/kotlin/json/RegressionTests.kt index 831aade5e82..6fefedc31c6 100644 --- a/gateway/src/commonTest/kotlin/json/RegressionTests.kt +++ b/gateway/src/commonTest/kotlin/json/RegressionTests.kt @@ -4,33 +4,28 @@ import dev.kord.gateway.Event import dev.kord.gateway.Reconnect import kotlinx.coroutines.test.runTest import kotlinx.serialization.json.Json -import kotlin.js.JsName import kotlin.test.Test private suspend fun file(name: String): String = readFile("regression", name) class RegressionTests { @Test - @JsName("test1") fun `Resume command serialization`() = runTest { val event = Json.decodeFromString(Event.DeserializationStrategy, file("eventWithDataThatShouldNotHaveData")) event shouldBe Reconnect } @Test - @JsName("test2") fun `Resumed with unknown data`() = runTest { Json.decodeFromString(Event.DeserializationStrategy, file("resumeWithUnknownData")) } @Test - @JsName("test3") fun `PresenceReplace with unknown data`() = runTest { Json.decodeFromString(Event.DeserializationStrategy, file("presenceReplaceWithUnknownData")) } @Test - @JsName("test4") fun `Unknown event with successfully parses`() = runTest { Json.decodeFromString(Event.DeserializationStrategy, file("eventWithUnknownData")) //dispatch event with non-existent type } diff --git a/gateway/src/commonTest/kotlin/json/SerializationTest.kt b/gateway/src/commonTest/kotlin/json/SerializationTest.kt index 23d0712136b..f55df9ac025 100644 --- a/gateway/src/commonTest/kotlin/json/SerializationTest.kt +++ b/gateway/src/commonTest/kotlin/json/SerializationTest.kt @@ -12,7 +12,6 @@ import kotlinx.serialization.ExperimentalSerializationApi import kotlinx.serialization.MissingFieldException import kotlinx.serialization.json.Json import kotlinx.serialization.json.JsonNull -import kotlin.js.JsName import kotlin.random.Random import kotlin.test.Test import kotlin.test.assertEquals @@ -24,7 +23,6 @@ private suspend fun file(name: String): String = readFile("event", name) class SerializationTest { @Test - @JsName("test1") fun `HeartbeatACK Event serialization`() = runTest { val event = Json.decodeFromString(Event.DeserializationStrategy, file("ack")) event shouldBe HeartbeatACK @@ -32,7 +30,6 @@ class SerializationTest { @Test - @JsName("test2") fun `Hello Event serialization`() = runTest { val event = Json.decodeFromString(Event.DeserializationStrategy, file("hello")) as Hello with(event) { @@ -42,7 +39,6 @@ class SerializationTest { @Test - @JsName("test3") fun `Reconnect Event serialization`() = runTest { val event = Json.decodeFromString(Event.DeserializationStrategy, file("reconnect")) event shouldBe Reconnect @@ -50,7 +46,6 @@ class SerializationTest { @Test - @JsName("test4") fun `Ready Event serialization`() = runTest { val event = Json.decodeFromString(Event.DeserializationStrategy, file("ready")) as Ready with(event.data) { @@ -83,14 +78,12 @@ class SerializationTest { } @Test - @JsName("test5") fun `Resumed Event serialization`() = runTest { Json.decodeFromString(Event.DeserializationStrategy, file("resumed")) as Resumed } @Test - @JsName("test6") fun `InvalidSession command serialization`() = runTest { val event = Json.decodeFromString(Event.DeserializationStrategy, file("invalid")) as InvalidSession with(event) { resumable shouldBe false } @@ -98,7 +91,6 @@ class SerializationTest { @Test - @JsName("test7") fun `ChannelPinsUpdate Event serialization`() = runTest { val event = Json.decodeFromString(Event.DeserializationStrategy, file("channelpinsupdate")) as ChannelPinsUpdate with(event.pins) { @@ -111,7 +103,6 @@ class SerializationTest { @Test - @JsName("test8") fun `ChannelCreate Event serialization`() = runTest { val event = Json.decodeFromString(Event.DeserializationStrategy, file("channelcreate")) as ChannelCreate with(event.channel) { @@ -131,7 +122,6 @@ class SerializationTest { @Test - @JsName("test9") fun `ChannelUpdate Event serialization`() = runTest { val event = Json.decodeFromString(Event.DeserializationStrategy, file("channelupdate")) as ChannelUpdate with(event.channel) { @@ -150,7 +140,6 @@ class SerializationTest { } @Test - @JsName("test10") fun `ChannelDelete Event serialization`() = runTest { val event = Json.decodeFromString(Event.DeserializationStrategy, file("channeldelete")) as ChannelDelete with(event.channel) { diff --git a/gateway/src/commonTest/kotlin/json/SnowflakeTest.kt b/gateway/src/commonTest/kotlin/json/SnowflakeTest.kt index d3db76c8ccd..a84243e777b 100644 --- a/gateway/src/commonTest/kotlin/json/SnowflakeTest.kt +++ b/gateway/src/commonTest/kotlin/json/SnowflakeTest.kt @@ -5,7 +5,6 @@ import kotlinx.serialization.ExperimentalSerializationApi import kotlinx.serialization.Serializable import kotlinx.serialization.encodeToString import kotlinx.serialization.json.* -import kotlin.js.JsName import kotlin.test.Test import kotlin.test.assertEquals @@ -15,7 +14,6 @@ class SnowflakeTest { private data class SnowflakeContainer(val snowflake: Snowflake) @Test - @JsName("test1") fun `Deserialization of Snowflake as String completes successfully`() { val value = "1337" val json = buildJsonObject { @@ -27,7 +25,6 @@ class SnowflakeTest { } @Test - @JsName("test2") fun `Deserialization of Snowflake as large String completes successfully`() { val value = Snowflake.validValues.last.toString() val json = buildJsonObject { @@ -39,7 +36,6 @@ class SnowflakeTest { } @Test - @JsName("test3") fun `Deserialization of Snowflake as Number completes successfully`() { val value = 1337L val json = buildJsonObject { @@ -51,7 +47,6 @@ class SnowflakeTest { } @Test - @JsName("test4") fun `Deserialization of Snowflake as large Number completes successfully`() { val value = Snowflake.validValues.last val json = buildJsonObject { @@ -64,7 +59,6 @@ class SnowflakeTest { } @Test - @JsName("test5") fun `Reserialization of Snowflake completes successfully`() { val json = buildJsonObject { put("snowflake", 1337L) } diff --git a/gateway/src/commonTest/kotlin/ratelimit/IdentifyRateLimiterTest.kt b/gateway/src/commonTest/kotlin/ratelimit/IdentifyRateLimiterTest.kt index 3202bd4bf31..47e137c7f70 100644 --- a/gateway/src/commonTest/kotlin/ratelimit/IdentifyRateLimiterTest.kt +++ b/gateway/src/commonTest/kotlin/ratelimit/IdentifyRateLimiterTest.kt @@ -9,14 +9,16 @@ import dev.kord.gateway.GatewayCloseCode.Unknown import dev.kord.gateway.InvalidSession import dev.kord.gateway.Ready import dev.kord.gateway.ReadyData -import kotlinx.coroutines.* +import kotlinx.coroutines.CompletableDeferred +import kotlinx.coroutines.CoroutineDispatcher import kotlinx.coroutines.channels.Channel +import kotlinx.coroutines.delay import kotlinx.coroutines.flow.* import kotlinx.coroutines.flow.SharingStarted.Companion.Eagerly +import kotlinx.coroutines.launch import kotlinx.coroutines.test.currentTime import kotlinx.coroutines.test.runTest import kotlin.coroutines.ContinuationInterceptor -import kotlin.js.JsName import kotlin.random.Random import kotlin.random.nextInt import kotlin.test.Test @@ -54,7 +56,6 @@ private val CLOSE = DiscordClose(closeCode = Unknown, recoverable = true) class IdentifyRateLimiterTest { @Test - @JsName("test1") fun `IdentifyRateLimiter throws IAEs`() = runTest { assertFailsWith { IdentifyRateLimiter(maxConcurrency = 0) } assertFailsWith { IdentifyRateLimiter(maxConcurrency = -1) } @@ -138,32 +139,26 @@ class IdentifyRateLimiterTest { // probably the most common case @Test - @JsName("test2") fun `single shard`() = testRateLimiter(shardIds = listOf(0), maxConcurrency = 1, expectedBuckets = 1) // https://discord.com/developers/docs/topics/gateway#sharding-max-concurrency @Test - @JsName("test3") fun `example 1`() = testRateLimiter(shardIds = 0..15, maxConcurrency = 16, expectedBuckets = 1) // https://discord.com/developers/docs/topics/gateway#sharding-max-concurrency @Test - @JsName("test4") fun `example 2`() = testRateLimiter(shardIds = 0..31, maxConcurrency = 16, expectedBuckets = 2) // https://discord.com/channels/613425648685547541/697489244649816084/1021565107949551676 @Test - @JsName("test5") fun `example 2 but without shards 15-30`() = testRateLimiter(shardIds = (0..14) + 31, maxConcurrency = 16, expectedBuckets = 1) // https://discord.com/channels/556525343595298817/1021384687337353216 @Test - @JsName("test6") fun `Schlaubi's case`() = testRateLimiter(shardIds = 0..14, maxConcurrency = 1, expectedBuckets = 15) @Test - @JsName("test7") fun `randomly distributed shards`() = testRateLimiter( shardIds = listOf(0, 4, 5, 10, 23), maxConcurrency = 2, @@ -172,7 +167,6 @@ class IdentifyRateLimiterTest { @Test - @JsName("test8") fun `IdentifyRateLimiter timeouts unresponsive gateways`() = runTest { val rateLimiter = IdentifyRateLimiter( maxConcurrency = 1, diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 7e4e3c23a31..39a9af8bcb1 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -1,7 +1,7 @@ [versions] # api dependencies -kotlin = "2.1.0-dev-6359" # https://github.com/JetBrains/kotlin +kotlin = "2.1.0-Beta1" # https://github.com/JetBrains/kotlin ktor = "2.3.12" # https://github.com/ktorio/ktor kotlinx-coroutines = "1.8.1" # https://github.com/Kotlin/kotlinx.coroutines kotlinx-serialization = "1.7.2" # https://github.com/Kotlin/kotlinx.serialization @@ -18,7 +18,7 @@ stately = "2.1.0" # https://github.com/touchlab/Stately fastZlib = "2.0.1" # https://github.com/timotejroiko/fast-zlib # code generation -ksp = "2.0.255-SNAPSHOT" # https://github.com/google/ksp +ksp = "2.0.20-1.0.24" # https://github.com/google/ksp kotlinpoet = "1.18.1" # https://github.com/square/kotlinpoet # tests diff --git a/rest/src/commonTest/kotlin/builder/CategoryModifyBuilderTest.kt b/rest/src/commonTest/kotlin/builder/CategoryModifyBuilderTest.kt index 7a2efe73d38..08af81c8913 100644 --- a/rest/src/commonTest/kotlin/builder/CategoryModifyBuilderTest.kt +++ b/rest/src/commonTest/kotlin/builder/CategoryModifyBuilderTest.kt @@ -2,14 +2,12 @@ package dev.kord.rest.builder import dev.kord.common.entity.optional.Optional import dev.kord.rest.builder.channel.CategoryModifyBuilder -import kotlin.js.JsName import kotlin.test.Test import kotlin.test.assertEquals class CategoryModifyBuilderTest { @Test - @JsName("test1") fun `builder does not create empty overwrites by default`() { val builder = CategoryModifyBuilder() diff --git a/rest/src/commonTest/kotlin/builder/EditGuildChannelBuilderTest.kt b/rest/src/commonTest/kotlin/builder/EditGuildChannelBuilderTest.kt index bbce3de7fd7..2b4d7613e5e 100644 --- a/rest/src/commonTest/kotlin/builder/EditGuildChannelBuilderTest.kt +++ b/rest/src/commonTest/kotlin/builder/EditGuildChannelBuilderTest.kt @@ -4,13 +4,11 @@ import dev.kord.common.entity.optional.Optional import dev.kord.rest.builder.channel.NewsChannelModifyBuilder import dev.kord.rest.builder.channel.TextChannelModifyBuilder import dev.kord.rest.builder.channel.VoiceChannelModifyBuilder -import kotlin.js.JsName import kotlin.test.Test import kotlin.test.assertEquals class EditGuildChannelBuilderTest { @Test - @JsName("test1") fun `text builder does not create empty overwrites by default`() { val builder = TextChannelModifyBuilder() @@ -20,7 +18,6 @@ class EditGuildChannelBuilderTest { } @Test - @JsName("test2") fun `voice builder does not create empty overwrites by default`() { val builder = VoiceChannelModifyBuilder() @@ -30,7 +27,6 @@ class EditGuildChannelBuilderTest { } @Test - @JsName("test3") fun `news builder does not create empty overwrites by default`() { val builder = NewsChannelModifyBuilder() diff --git a/rest/src/commonTest/kotlin/builder/EmojiModifyBuilderTest.kt b/rest/src/commonTest/kotlin/builder/EmojiModifyBuilderTest.kt index e413f431e04..a42c0da8b03 100644 --- a/rest/src/commonTest/kotlin/builder/EmojiModifyBuilderTest.kt +++ b/rest/src/commonTest/kotlin/builder/EmojiModifyBuilderTest.kt @@ -2,14 +2,12 @@ package dev.kord.rest.builder import dev.kord.common.entity.optional.Optional import dev.kord.rest.builder.guild.EmojiModifyBuilder -import kotlin.js.JsName import kotlin.test.Test import kotlin.test.assertEquals class EmojiModifyBuilderTest { @Test - @JsName("test1") fun `builder does not create empty roles by default`() { val builder = EmojiModifyBuilder() diff --git a/rest/src/commonTest/kotlin/builder/MemberModifyBuilderTest.kt b/rest/src/commonTest/kotlin/builder/MemberModifyBuilderTest.kt index 966f7c1a982..e705badb02c 100644 --- a/rest/src/commonTest/kotlin/builder/MemberModifyBuilderTest.kt +++ b/rest/src/commonTest/kotlin/builder/MemberModifyBuilderTest.kt @@ -2,14 +2,12 @@ package dev.kord.rest.builder import dev.kord.common.entity.optional.Optional import dev.kord.rest.builder.member.MemberModifyBuilder -import kotlin.js.JsName import kotlin.test.Test import kotlin.test.assertEquals class MemberModifyBuilderTest { @Test - @JsName("test1") fun `builder does not create empty roles by default`() { val builder = MemberModifyBuilder() diff --git a/rest/src/commonTest/kotlin/builder/guild/GuildModifyBuilderTest.kt b/rest/src/commonTest/kotlin/builder/guild/GuildModifyBuilderTest.kt index 9404eaf5746..c456f9d411e 100644 --- a/rest/src/commonTest/kotlin/builder/guild/GuildModifyBuilderTest.kt +++ b/rest/src/commonTest/kotlin/builder/guild/GuildModifyBuilderTest.kt @@ -2,14 +2,12 @@ package dev.kord.rest.builder.guild import dev.kord.common.Locale import dev.kord.common.entity.optional.Optional -import kotlin.js.JsName import kotlin.test.Test import kotlin.test.assertEquals internal class GuildModifyBuilderTest { @Test - @JsName("test1") fun `builder omits non -region and -language`() { val builder = GuildModifyBuilder() builder.preferredLocale = Locale.ENGLISH_GREAT_BRITAIN diff --git a/rest/src/commonTest/kotlin/json/AuditLogResponseTest.kt b/rest/src/commonTest/kotlin/json/AuditLogResponseTest.kt index c53cb4a83cf..368b8d01bc4 100644 --- a/rest/src/commonTest/kotlin/json/AuditLogResponseTest.kt +++ b/rest/src/commonTest/kotlin/json/AuditLogResponseTest.kt @@ -3,13 +3,11 @@ package dev.kord.rest.json import dev.kord.common.entity.DiscordAuditLog import kotlinx.coroutines.test.runTest import kotlinx.serialization.json.Json -import kotlin.js.JsName import kotlin.test.Test class AuditLogResponseTest { @Test - @JsName("test1") fun `AuditLogResponseSerialization serialization`() = runTest { val json = file("auditlog") diff --git a/rest/src/commonTest/kotlin/json/ErrorTest.kt b/rest/src/commonTest/kotlin/json/ErrorTest.kt index 7b641c3b218..79b951de284 100644 --- a/rest/src/commonTest/kotlin/json/ErrorTest.kt +++ b/rest/src/commonTest/kotlin/json/ErrorTest.kt @@ -3,7 +3,6 @@ package dev.kord.rest.json import dev.kord.rest.json.response.DiscordErrorResponse import kotlinx.coroutines.test.runTest import kotlinx.serialization.json.Json -import kotlin.js.JsName import kotlin.test.Test import kotlin.test.assertEquals @@ -16,7 +15,6 @@ class ErrorTest { } @Test - @JsName("test1") fun `correctly serialize error`() = runTest { val content = file("error") val parsed = parser.decodeFromString(DiscordErrorResponse.serializer(), content) diff --git a/rest/src/commonTest/kotlin/ratelimit/AbstractRequestRateLimiterTest.kt b/rest/src/commonTest/kotlin/ratelimit/AbstractRequestRateLimiterTest.kt index fcd32821356..38a2a890262 100644 --- a/rest/src/commonTest/kotlin/ratelimit/AbstractRequestRateLimiterTest.kt +++ b/rest/src/commonTest/kotlin/ratelimit/AbstractRequestRateLimiterTest.kt @@ -10,7 +10,6 @@ import kotlinx.coroutines.withTimeout import kotlinx.coroutines.withTimeoutOrNull import kotlinx.datetime.Clock import kotlinx.datetime.Instant -import kotlin.js.JsName import kotlin.test.Test import kotlin.test.assertEquals import kotlin.time.Duration.Companion.seconds @@ -86,7 +85,6 @@ abstract class AbstractRequestRateLimiterTest { } @Test - @JsName("test1") fun `concurrent requests on the same route are handled sequentially`() = runTest { val clock = TestClock(instant, this) val rateLimiter = newRequestRateLimiter(clock) @@ -104,7 +102,6 @@ abstract class AbstractRequestRateLimiterTest { } @Test - @JsName("test2") fun `a RequestRateLimiter will suspend for rate limited requests with the same identifier`() = runTest { val clock = TestClock(instant, this) val rateLimiter = newRequestRateLimiter(clock) @@ -116,7 +113,6 @@ abstract class AbstractRequestRateLimiterTest { } @Test - @JsName("test3") fun `a RequestRateLimiter will suspend for rate limited requests with the same bucket`() = runTest { val clock = TestClock(instant, this) val rateLimiter = newRequestRateLimiter(clock) @@ -129,7 +125,6 @@ abstract class AbstractRequestRateLimiterTest { } @Test - @JsName("test4") fun `a RequestRateLimiter will not suspend for rate limited requests that don't share an identifier`() = runTest { val clock = TestClock(instant, this) val rateLimiter = newRequestRateLimiter(clock) @@ -142,7 +137,6 @@ abstract class AbstractRequestRateLimiterTest { } @Test - @JsName("test5") fun `an exception during the handling won't lock the handler`() = runTest { val clock = TestClock(instant, this) val rateLimiter = newRequestRateLimiter(clock) @@ -169,7 +163,6 @@ abstract class AbstractRequestRateLimiterTest { } @Test - @JsName("test6") fun `REGRESSION a RequestRateLimiter encountering a non 429 error response will not throw`() = runTest { val clock = TestClock(instant, this) val rateLimiter = newRequestRateLimiter(clock) diff --git a/rest/src/commonTest/kotlin/request/MessageRequests.kt b/rest/src/commonTest/kotlin/request/MessageRequests.kt index 6e43c1d9dec..02ee86adcc1 100644 --- a/rest/src/commonTest/kotlin/request/MessageRequests.kt +++ b/rest/src/commonTest/kotlin/request/MessageRequests.kt @@ -16,7 +16,6 @@ import kotlinx.coroutines.test.runTest import kotlinx.datetime.Clock import kotlinx.serialization.encodeToString import kotlinx.serialization.json.Json -import kotlin.js.JsName import kotlin.test.Test import kotlin.test.assertEquals import kotlin.test.assertFalse @@ -51,7 +50,6 @@ private val mockMessage = DiscordMessage( class MessageRequests { @Test - @JsName("test1") fun `attachment channel is read and closed lazily`() = runTest { val mockEngine = MockEngine { request -> diff --git a/rest/src/commonTest/kotlin/request/StackTraceRecoveryTest.kt b/rest/src/commonTest/kotlin/request/StackTraceRecoveryTest.kt index 69aa3eadcd2..e1a5df63a3c 100644 --- a/rest/src/commonTest/kotlin/request/StackTraceRecoveryTest.kt +++ b/rest/src/commonTest/kotlin/request/StackTraceRecoveryTest.kt @@ -8,7 +8,6 @@ import io.ktor.http.* import io.ktor.util.* import io.ktor.utils.io.* import kotlinx.coroutines.test.runTest -import kotlin.js.JsName import kotlin.test.Test expect class StackTraceElement @@ -18,7 +17,6 @@ internal expect fun RecoveredStackTrace.validate(expected: StackTraceElement) class StackTraceRecoveryTest { @Test - @JsName("test1") fun `test stack trace recovery`() = runTest { val mockEngine = MockEngine { respond(