From 8ade1af4eeb5e03f53caa99c976f969102efd4c0 Mon Sep 17 00:00:00 2001 From: manu Date: Wed, 14 Feb 2024 13:02:09 +0100 Subject: [PATCH] Removed common stuff --- .../ivianuu/injekt/common/CollectionModule.kt | 14 -------- .../ivianuu/injekt/common/ReflectModule.kt | 15 --------- .../injekt/common/CommonInjectablesTest.kt | 32 ------------------- 3 files changed, 61 deletions(-) delete mode 100644 common/src/commonMain/kotlin/com/ivianuu/injekt/common/CollectionModule.kt delete mode 100644 common/src/commonMain/kotlin/com/ivianuu/injekt/common/ReflectModule.kt delete mode 100644 common/src/jvmTest/kotlin/com/ivianuu/injekt/common/CommonInjectablesTest.kt diff --git a/common/src/commonMain/kotlin/com/ivianuu/injekt/common/CollectionModule.kt b/common/src/commonMain/kotlin/com/ivianuu/injekt/common/CollectionModule.kt deleted file mode 100644 index 858bebb042..0000000000 --- a/common/src/commonMain/kotlin/com/ivianuu/injekt/common/CollectionModule.kt +++ /dev/null @@ -1,14 +0,0 @@ -/* - * Copyright 2022 Manuel Wrage. Use of this source code is governed by the Apache 2.0 license. - */ - -package com.ivianuu.injekt.common - -import com.ivianuu.injekt.Provide - -@Provide object CollectionModule { - /** - * Provides a [Map] of [K] [V] for each [List] of [Pair] of [K] [V] - */ - @Provide inline fun mapOfPairs(pairs: List>): Map = pairs.toMap() -} diff --git a/common/src/commonMain/kotlin/com/ivianuu/injekt/common/ReflectModule.kt b/common/src/commonMain/kotlin/com/ivianuu/injekt/common/ReflectModule.kt deleted file mode 100644 index 8e34cd494c..0000000000 --- a/common/src/commonMain/kotlin/com/ivianuu/injekt/common/ReflectModule.kt +++ /dev/null @@ -1,15 +0,0 @@ -/* - * Copyright 2022 Manuel Wrage. Use of this source code is governed by the Apache 2.0 license. - */ - -package com.ivianuu.injekt.common - -import com.ivianuu.injekt.Provide -import kotlin.reflect.KClass - -@Provide object ReflectModule { - /** - * Provides a [KClass] of [T] - */ - @Provide inline fun kClass(): KClass = T::class -} diff --git a/common/src/jvmTest/kotlin/com/ivianuu/injekt/common/CommonInjectablesTest.kt b/common/src/jvmTest/kotlin/com/ivianuu/injekt/common/CommonInjectablesTest.kt deleted file mode 100644 index e36d948ebc..0000000000 --- a/common/src/jvmTest/kotlin/com/ivianuu/injekt/common/CommonInjectablesTest.kt +++ /dev/null @@ -1,32 +0,0 @@ -/* - * Copyright 2022 Manuel Wrage. Use of this source code is governed by the Apache 2.0 license. - */ - -package com.ivianuu.injekt.common - -import com.ivianuu.injekt.Provide -import com.ivianuu.injekt.inject -import io.kotest.matchers.shouldBe -import org.junit.Test -import kotlin.reflect.KClass - -class CommonInjectablesTest { - @Test fun testCanResolveMap() { - @Provide val elementsA = listOf("a" to "a") - @Provide val elementB = "b" to "b" - val map = inject>() - map.size shouldBe 2 - map["a"] shouldBe "a" - map["b"] shouldBe "b" - } - - @Test fun testCanResolveKClass() { - inject>() - } - - @Test fun testCanResolveTypeKey() { - inject>() - } - - @Provide private class Foo -}