diff --git a/CHANGELOG.adoc b/CHANGELOG.adoc index 9ea92172..6bd5a79c 100644 --- a/CHANGELOG.adoc +++ b/CHANGELOG.adoc @@ -37,6 +37,8 @@ toc::[] === Fixed +* Warnings for unused expression and unused parameter in MockFactory + === Security === Bumped diff --git a/kmock-processor/src/main/kotlin/tech/antibytes/kmock/processor/factory/KMockFactoryEntryPointGenerator.kt b/kmock-processor/src/main/kotlin/tech/antibytes/kmock/processor/factory/KMockFactoryEntryPointGenerator.kt index 938a7b06..80303819 100644 --- a/kmock-processor/src/main/kotlin/tech/antibytes/kmock/processor/factory/KMockFactoryEntryPointGenerator.kt +++ b/kmock-processor/src/main/kotlin/tech/antibytes/kmock/processor/factory/KMockFactoryEntryPointGenerator.kt @@ -6,6 +6,7 @@ package tech.antibytes.kmock.processor.factory +import com.squareup.kotlinpoet.AnnotationSpec import com.squareup.kotlinpoet.FileSpec import com.squareup.kotlinpoet.FunSpec import com.squareup.kotlinpoet.KModifier @@ -15,6 +16,7 @@ import tech.antibytes.kmock.processor.ProcessorContract import tech.antibytes.kmock.processor.ProcessorContract.Companion.KMOCK_CONTRACT import tech.antibytes.kmock.processor.ProcessorContract.Companion.KMOCK_FACTORY_TYPE_NAME import tech.antibytes.kmock.processor.ProcessorContract.Companion.KSPY_FACTORY_TYPE_NAME +import tech.antibytes.kmock.processor.ProcessorContract.Companion.NOOP_COLLECTOR_NAME import tech.antibytes.kmock.processor.ProcessorContract.TemplateSource internal class KMockFactoryEntryPointGenerator( @@ -22,6 +24,12 @@ internal class KMockFactoryEntryPointGenerator( private val genericResolver: ProcessorContract.GenericResolver, private val codeGenerator: ProcessorContract.KmpCodeGenerator, ) : ProcessorContract.MockFactoryEntryPointGenerator { + private val unused = AnnotationSpec.builder(Suppress::class).addMember( + "%S, %S", + "UNUSED_PARAMETER", + "UNUSED_EXPRESSION" + ).build() + private fun buildMockFactory(): FunSpec { val type = TypeVariableName(KMOCK_FACTORY_TYPE_NAME) @@ -119,7 +127,9 @@ internal class KMockFactoryEntryPointGenerator( ) val (_, generics) = utils.splitInterfacesIntoRegularAndGenerics(templateSources) + file.addAnnotation(unused) file.addImport(KMOCK_CONTRACT.packageName, KMOCK_CONTRACT.simpleName) + file.addImport(NOOP_COLLECTOR_NAME.packageName, NOOP_COLLECTOR_NAME.simpleName) file.addFunction(buildMockFactory()) file.addFunction(buildSpyFactory()) @@ -149,8 +159,10 @@ internal class KMockFactoryEntryPointGenerator( options.rootPackage, "MockFactory" ) + file.addAnnotation(unused) file.addImport(KMOCK_CONTRACT.packageName, KMOCK_CONTRACT.simpleName) + file.addImport(NOOP_COLLECTOR_NAME.packageName, NOOP_COLLECTOR_NAME.simpleName) generateGenericEntryPoints( file, diff --git a/kmock-processor/src/main/kotlin/tech/antibytes/kmock/processor/factory/KMockFactoryGenerator.kt b/kmock-processor/src/main/kotlin/tech/antibytes/kmock/processor/factory/KMockFactoryGenerator.kt index 062b5026..4b9aeab3 100644 --- a/kmock-processor/src/main/kotlin/tech/antibytes/kmock/processor/factory/KMockFactoryGenerator.kt +++ b/kmock-processor/src/main/kotlin/tech/antibytes/kmock/processor/factory/KMockFactoryGenerator.kt @@ -9,6 +9,7 @@ package tech.antibytes.kmock.processor.factory import com.google.devtools.ksp.processing.CodeGenerator import com.google.devtools.ksp.processing.KSPLogger import com.google.devtools.ksp.symbol.KSFile +import com.squareup.kotlinpoet.AnnotationSpec import com.squareup.kotlinpoet.FileSpec import com.squareup.kotlinpoet.FunSpec import com.squareup.kotlinpoet.KModifier @@ -19,6 +20,7 @@ import tech.antibytes.kmock.processor.ProcessorContract import tech.antibytes.kmock.processor.ProcessorContract.Companion.KMOCK_CONTRACT import tech.antibytes.kmock.processor.ProcessorContract.Companion.KMOCK_FACTORY_TYPE_NAME import tech.antibytes.kmock.processor.ProcessorContract.Companion.KSPY_FACTORY_TYPE_NAME +import tech.antibytes.kmock.processor.ProcessorContract.Companion.NOOP_COLLECTOR_NAME import tech.antibytes.kmock.processor.ProcessorContract.Relaxer import tech.antibytes.kmock.processor.ProcessorContract.TemplateSource @@ -31,6 +33,12 @@ internal class KMockFactoryGenerator( private val genericResolver: ProcessorContract.GenericResolver, private val codeGenerator: CodeGenerator, ) : ProcessorContract.MockFactoryGenerator { + private val unused = AnnotationSpec.builder(Suppress::class).addMember( + "%S, %S", + "UNUSED_PARAMETER", + "UNUSED_EXPRESSION" + ).build() + private fun buildGenericsInfo( generics: List ): String { @@ -326,8 +334,13 @@ internal class KMockFactoryGenerator( options.rootPackage, "MockFactory" ) + file.addAnnotation(unused) file.addImport(KMOCK_CONTRACT.packageName, KMOCK_CONTRACT.simpleName) + if (!options.isKmp) { + file.addImport(NOOP_COLLECTOR_NAME.packageName, NOOP_COLLECTOR_NAME.simpleName) + } + val (regular, generics) = utils.splitInterfacesIntoRegularAndGenerics(templateSources) val genericFactories = buildGenericFactories( diff --git a/kmock-processor/src/main/kotlin/tech/antibytes/kmock/processor/factory/KMockFactoryGeneratorUtil.kt b/kmock-processor/src/main/kotlin/tech/antibytes/kmock/processor/factory/KMockFactoryGeneratorUtil.kt index 3529b96a..d3d720d2 100644 --- a/kmock-processor/src/main/kotlin/tech/antibytes/kmock/processor/factory/KMockFactoryGeneratorUtil.kt +++ b/kmock-processor/src/main/kotlin/tech/antibytes/kmock/processor/factory/KMockFactoryGeneratorUtil.kt @@ -6,7 +6,6 @@ package tech.antibytes.kmock.processor.factory -import com.squareup.kotlinpoet.AnnotationSpec import com.squareup.kotlinpoet.FunSpec import com.squareup.kotlinpoet.KModifier import com.squareup.kotlinpoet.ParameterSpec @@ -18,8 +17,6 @@ import tech.antibytes.kmock.processor.ProcessorContract.TemplateSource internal class KMockFactoryGeneratorUtil( private val genericResolver: ProcessorContract.GenericResolver ) : ProcessorContract.MockFactoryGeneratorUtil { - private val unused = AnnotationSpec.builder(Suppress::class).addMember("%S", "UNUSED_PARAMETER").build() - private fun buildGenericFactoryArgument( identifier: TypeVariableName, generics: List @@ -48,7 +45,7 @@ internal class KMockFactoryGeneratorUtil( ParameterSpec.builder( name = "templateType", type = buildGenericFactoryArgument(identifier, generics) - ).addAnnotation(unused).build() + ).build() ) } @@ -63,7 +60,7 @@ internal class KMockFactoryGeneratorUtil( parameter.defaultValue("false") } - return parameter.addAnnotation(unused).build() + return parameter.build() } private fun buildUnitRelaxedParameter( @@ -74,7 +71,7 @@ internal class KMockFactoryGeneratorUtil( parameter.defaultValue("false") } - return parameter.addAnnotation(unused).build() + return parameter.build() } private fun buildVerifierParameter( @@ -82,14 +79,14 @@ internal class KMockFactoryGeneratorUtil( ): ParameterSpec { val parameter = ParameterSpec.builder("verifier", ProcessorContract.COLLECTOR_NAME) if (hasDefault) { - parameter.defaultValue("Collector { _, _ -> Unit }") + parameter.defaultValue("NoopCollector") } return parameter.build() } private fun buildFreezeParameter( - hasDefault: Boolean + hasDefault: Boolean, ): ParameterSpec { val parameter = ParameterSpec.builder("freeze", Boolean::class) if (hasDefault) { @@ -122,7 +119,6 @@ internal class KMockFactoryGeneratorUtil( private fun buildSpyParameter(): ParameterSpec { return ParameterSpec.builder("spyOn", TypeVariableName("SpyOn")) - .addAnnotation(unused) .build() } diff --git a/kmock-processor/src/test/resources/factory/expected/alias/CommonActual.kt b/kmock-processor/src/test/resources/factory/expected/alias/CommonActual.kt index 6ae1e73c..869c8aa2 100644 --- a/kmock-processor/src/test/resources/factory/expected/alias/CommonActual.kt +++ b/kmock-processor/src/test/resources/factory/expected/alias/CommonActual.kt @@ -1,3 +1,5 @@ +@file:Suppress("UNUSED_PARAMETER", "UNUSED_EXPRESSION") + package generatorTest import kotlin.Boolean @@ -7,8 +9,8 @@ import tech.antibytes.kmock.KMockContract.Collector internal actual inline fun kmock( verifier: KMockContract.Collector, - @Suppress("UNUSED_PARAMETER") relaxed: Boolean, - @Suppress("UNUSED_PARAMETER") relaxUnitFun: Boolean, + relaxed: Boolean, + relaxUnitFun: Boolean, freeze: Boolean ): Mock = when (Mock::class) { factory.template.alias.AliasCommonMock::class -> factory.template.alias.AliasCommonMock(verifier = @@ -17,7 +19,7 @@ internal actual inline fun kmock( } internal actual inline fun kspy( - @Suppress("UNUSED_PARAMETER") spyOn: SpyOn, + spyOn: SpyOn, verifier: KMockContract.Collector, freeze: Boolean ): Mock = when (Mock::class) { diff --git a/kmock-processor/src/test/resources/factory/expected/alias/CommonExpect.kt b/kmock-processor/src/test/resources/factory/expected/alias/CommonExpect.kt index ee4300d0..5d597298 100644 --- a/kmock-processor/src/test/resources/factory/expected/alias/CommonExpect.kt +++ b/kmock-processor/src/test/resources/factory/expected/alias/CommonExpect.kt @@ -1,19 +1,22 @@ +@file:Suppress("UNUSED_PARAMETER", "UNUSED_EXPRESSION") + package generatorTest import kotlin.Boolean import kotlin.Suppress import tech.antibytes.kmock.KMockContract import tech.antibytes.kmock.KMockContract.Collector +import tech.antibytes.kmock.proxy.NoopCollector internal expect inline fun kmock( - verifier: KMockContract.Collector = Collector { _, _ -> Unit }, - @Suppress("UNUSED_PARAMETER") relaxed: Boolean = false, - @Suppress("UNUSED_PARAMETER") relaxUnitFun: Boolean = false, + verifier: KMockContract.Collector = NoopCollector, + relaxed: Boolean = false, + relaxUnitFun: Boolean = false, freeze: Boolean = true ): Mock internal expect inline fun kspy( - @Suppress("UNUSED_PARAMETER") spyOn: SpyOn, - verifier: KMockContract.Collector = Collector { _, _ -> Unit }, + spyOn: SpyOn, + verifier: KMockContract.Collector = NoopCollector, freeze: Boolean = true ): Mock diff --git a/kmock-processor/src/test/resources/factory/expected/alias/Generic.kt b/kmock-processor/src/test/resources/factory/expected/alias/Generic.kt index 54fe1544..40c397c0 100644 --- a/kmock-processor/src/test/resources/factory/expected/alias/Generic.kt +++ b/kmock-processor/src/test/resources/factory/expected/alias/Generic.kt @@ -1,3 +1,5 @@ +@file:Suppress("UNUSED_PARAMETER", "UNUSED_EXPRESSION") + package generatorTest import factory.template.alias.Generic @@ -7,30 +9,30 @@ import kotlin.Comparable import kotlin.Suppress import tech.antibytes.kmock.KMockContract import tech.antibytes.kmock.KMockContract.Collector +import tech.antibytes.kmock.proxy.NoopCollector internal inline fun kmock( - verifier: KMockContract.Collector = Collector { _, _ -> Unit }, - @Suppress("UNUSED_PARAMETER") relaxed: Boolean = false, - @Suppress("UNUSED_PARAMETER") relaxUnitFun: Boolean = false, + verifier: KMockContract.Collector = NoopCollector, + relaxed: Boolean = false, + relaxUnitFun: Boolean = false, freeze: Boolean = true ): Mock = when (Mock::class) { else -> throw RuntimeException("Unknown Interface ${Mock::class.simpleName}.") } internal inline fun kspy( - @Suppress("UNUSED_PARAMETER") spyOn: SpyOn, - verifier: KMockContract.Collector = Collector { _, _ -> Unit }, + spyOn: SpyOn, + verifier: KMockContract.Collector = NoopCollector, freeze: Boolean = true ): Mock = when (Mock::class) { else -> throw RuntimeException("Unknown Interface ${Mock::class.simpleName}.") } internal inline fun , K : Any, L> kmock( - verifier: KMockContract.Collector = Collector { _, _ -> Unit }, - @Suppress("UNUSED_PARAMETER") relaxed: Boolean = false, - @Suppress("UNUSED_PARAMETER") relaxUnitFun: Boolean = false, + verifier: KMockContract.Collector = NoopCollector, + relaxed: Boolean = false, + relaxUnitFun: Boolean = false, freeze: Boolean = true, - @Suppress("UNUSED_PARAMETER") templateType: kotlin.reflect.KClass> ): Mock where L : Any, L : Comparable = when (Mock::class) { factory.template.alias.AliasGenericMock::class -> factory.template.alias.AliasGenericMock, K : Any, L> kmock( } internal inline fun , K : Any, L> kspy( - @Suppress("UNUSED_PARAMETER") spyOn: SpyOn, - verifier: KMockContract.Collector = Collector { _, _ -> Unit }, + spyOn: SpyOn, + verifier: KMockContract.Collector = NoopCollector, freeze: Boolean = true, - @Suppress("UNUSED_PARAMETER") templateType: kotlin.reflect.KClass> ): Mock where L : Any, L : Comparable = when (Mock::class) { else -> throw RuntimeException("Unknown Interface ${Mock::class.simpleName}.") diff --git a/kmock-processor/src/test/resources/factory/expected/alias/Platform.kt b/kmock-processor/src/test/resources/factory/expected/alias/Platform.kt index b1dcd0b9..c5cae254 100644 --- a/kmock-processor/src/test/resources/factory/expected/alias/Platform.kt +++ b/kmock-processor/src/test/resources/factory/expected/alias/Platform.kt @@ -1,14 +1,17 @@ +@file:Suppress("UNUSED_PARAMETER", "UNUSED_EXPRESSION") + package generatorTest import kotlin.Boolean import kotlin.Suppress import tech.antibytes.kmock.KMockContract import tech.antibytes.kmock.KMockContract.Collector +import tech.antibytes.kmock.proxy.NoopCollector internal inline fun kmock( - verifier: KMockContract.Collector = Collector { _, _ -> Unit }, - @Suppress("UNUSED_PARAMETER") relaxed: Boolean = false, - @Suppress("UNUSED_PARAMETER") relaxUnitFun: Boolean = false, + verifier: KMockContract.Collector = NoopCollector, + relaxed: Boolean = false, + relaxUnitFun: Boolean = false, freeze: Boolean = true ): Mock = when (Mock::class) { factory.template.alias.AliasPlatformMock::class -> @@ -18,8 +21,8 @@ internal inline fun kmock( } internal inline fun kspy( - @Suppress("UNUSED_PARAMETER") spyOn: SpyOn, - verifier: KMockContract.Collector = Collector { _, _ -> Unit }, + spyOn: SpyOn, + verifier: KMockContract.Collector = NoopCollector, freeze: Boolean = true ): Mock = when (Mock::class) { else -> throw RuntimeException("Unknown Interface ${Mock::class.simpleName}.") diff --git a/kmock-processor/src/test/resources/factory/expected/generic/CommonActual.kt b/kmock-processor/src/test/resources/factory/expected/generic/CommonActual.kt index 39425af8..2fd8e37d 100644 --- a/kmock-processor/src/test/resources/factory/expected/generic/CommonActual.kt +++ b/kmock-processor/src/test/resources/factory/expected/generic/CommonActual.kt @@ -1,3 +1,5 @@ +@file:Suppress("UNUSED_PARAMETER", "UNUSED_EXPRESSION") + package generatorTest import factory.template.generic.Common @@ -10,15 +12,15 @@ import tech.antibytes.kmock.KMockContract.Collector internal actual inline fun kmock( verifier: KMockContract.Collector, - @Suppress("UNUSED_PARAMETER") relaxed: Boolean, - @Suppress("UNUSED_PARAMETER") relaxUnitFun: Boolean, + relaxed: Boolean, + relaxUnitFun: Boolean, freeze: Boolean ): Mock = when (Mock::class) { else -> throw RuntimeException("Unknown Interface ${Mock::class.simpleName}.") } internal actual inline fun kspy( - @Suppress("UNUSED_PARAMETER") spyOn: SpyOn, + spyOn: SpyOn, verifier: KMockContract.Collector, freeze: Boolean ): Mock = when (Mock::class) { @@ -27,10 +29,9 @@ internal actual inline fun kspy( internal actual inline fun , K : Any, L> kmock( verifier: KMockContract.Collector, - @Suppress("UNUSED_PARAMETER") relaxed: Boolean, - @Suppress("UNUSED_PARAMETER") relaxUnitFun: Boolean, + relaxed: Boolean, + relaxUnitFun: Boolean, freeze: Boolean, - @Suppress("UNUSED_PARAMETER") templateType: kotlin.reflect.KClass> ): Mock where L : Any, L : Comparable = when (Mock::class) { factory.template.generic.CommonMock::class -> factory.template.generic.CommonMock(verifier = @@ -39,11 +40,10 @@ internal actual inline fun , K : Any, L> kmock( } internal actual inline fun , K : Any, L> kspy( - @Suppress("UNUSED_PARAMETER") spyOn: SpyOn, + spyOn: SpyOn, verifier: KMockContract.Collector, freeze: Boolean, - @Suppress("UNUSED_PARAMETER") - templateType: kotlin.reflect.KClass> +templateType: kotlin.reflect.KClass> ): Mock where L : Any, L : Comparable = when (Mock::class) { else -> throw RuntimeException("Unknown Interface ${Mock::class.simpleName}.") } diff --git a/kmock-processor/src/test/resources/factory/expected/generic/CommonExpect.kt b/kmock-processor/src/test/resources/factory/expected/generic/CommonExpect.kt index b8c800f3..a85479e9 100644 --- a/kmock-processor/src/test/resources/factory/expected/generic/CommonExpect.kt +++ b/kmock-processor/src/test/resources/factory/expected/generic/CommonExpect.kt @@ -1,3 +1,5 @@ +@file:Suppress("UNUSED_PARAMETER", "UNUSED_EXPRESSION") + package generatorTest import factory.template.generic.Common @@ -7,33 +9,32 @@ import kotlin.Comparable import kotlin.Suppress import tech.antibytes.kmock.KMockContract import tech.antibytes.kmock.KMockContract.Collector +import tech.antibytes.kmock.proxy.NoopCollector internal expect inline fun kmock( - verifier: KMockContract.Collector = Collector { _, _ -> Unit }, - @Suppress("UNUSED_PARAMETER") relaxed: Boolean = false, - @Suppress("UNUSED_PARAMETER") relaxUnitFun: Boolean = false, + verifier: KMockContract.Collector = NoopCollector, + relaxed: Boolean = false, + relaxUnitFun: Boolean = false, freeze: Boolean = true ): Mock internal expect inline fun kspy( - @Suppress("UNUSED_PARAMETER") spyOn: SpyOn, - verifier: KMockContract.Collector = Collector { _, _ -> Unit }, + spyOn: SpyOn, + verifier: KMockContract.Collector = NoopCollector, freeze: Boolean = true ): Mock internal expect inline fun , K : Any, L> kmock( - verifier: KMockContract.Collector = Collector { _, _ -> Unit }, - @Suppress("UNUSED_PARAMETER") relaxed: Boolean = false, - @Suppress("UNUSED_PARAMETER") relaxUnitFun: Boolean = false, + verifier: KMockContract.Collector = NoopCollector, + relaxed: Boolean = false, + relaxUnitFun: Boolean = false, freeze: Boolean = true, - @Suppress("UNUSED_PARAMETER") templateType: kotlin.reflect.KClass> ): Mock where L : Any, L : Comparable internal expect inline fun , K : Any, L> kspy( - @Suppress("UNUSED_PARAMETER") spyOn: SpyOn, - verifier: KMockContract.Collector = Collector { _, _ -> Unit }, + spyOn: SpyOn, + verifier: KMockContract.Collector = NoopCollector, freeze: Boolean = true, - @Suppress("UNUSED_PARAMETER") templateType: kotlin.reflect.KClass> ): Mock where L : Any, L : Comparable diff --git a/kmock-processor/src/test/resources/factory/expected/generic/Platform.kt b/kmock-processor/src/test/resources/factory/expected/generic/Platform.kt index 18de9908..a651547b 100644 --- a/kmock-processor/src/test/resources/factory/expected/generic/Platform.kt +++ b/kmock-processor/src/test/resources/factory/expected/generic/Platform.kt @@ -1,3 +1,5 @@ +@file:Suppress("UNUSED_PARAMETER", "UNUSED_EXPRESSION") + package generatorTest import factory.template.generic.Platform @@ -7,30 +9,30 @@ import kotlin.Comparable import kotlin.Suppress import tech.antibytes.kmock.KMockContract import tech.antibytes.kmock.KMockContract.Collector +import tech.antibytes.kmock.proxy.NoopCollector internal inline fun kmock( - verifier: KMockContract.Collector = Collector { _, _ -> Unit }, - @Suppress("UNUSED_PARAMETER") relaxed: Boolean = false, - @Suppress("UNUSED_PARAMETER") relaxUnitFun: Boolean = false, + verifier: KMockContract.Collector = NoopCollector, + relaxed: Boolean = false, + relaxUnitFun: Boolean = false, freeze: Boolean = true ): Mock = when (Mock::class) { else -> throw RuntimeException("Unknown Interface ${Mock::class.simpleName}.") } internal inline fun kspy( - @Suppress("UNUSED_PARAMETER") spyOn: SpyOn, - verifier: KMockContract.Collector = Collector { _, _ -> Unit }, + spyOn: SpyOn, + verifier: KMockContract.Collector = NoopCollector, freeze: Boolean = true ): Mock = when (Mock::class) { else -> throw RuntimeException("Unknown Interface ${Mock::class.simpleName}.") } internal inline fun , K : Any, L> kmock( - verifier: KMockContract.Collector = Collector { _, _ -> Unit }, - @Suppress("UNUSED_PARAMETER") relaxed: Boolean = false, - @Suppress("UNUSED_PARAMETER") relaxUnitFun: Boolean = false, + verifier: KMockContract.Collector = NoopCollector, + relaxed: Boolean = false, + relaxUnitFun: Boolean = false, freeze: Boolean = true, - @Suppress("UNUSED_PARAMETER") templateType: kotlin.reflect.KClass> ): Mock where L : Any, L : Comparable = when (Mock::class) { factory.template.generic.PlatformMock::class -> factory.template.generic.PlatformMock, K : Any, L> kmock( } internal inline fun , K : Any, L> kspy( - @Suppress("UNUSED_PARAMETER") spyOn: SpyOn, - verifier: KMockContract.Collector = Collector { _, _ -> Unit }, + spyOn: SpyOn, + verifier: KMockContract.Collector = NoopCollector, freeze: Boolean = true, - @Suppress("UNUSED_PARAMETER") templateType: kotlin.reflect.KClass> ): Mock where L : Any, L : Comparable = when (Mock::class) { else -> throw RuntimeException("Unknown Interface ${Mock::class.simpleName}.") diff --git a/kmock-processor/src/test/resources/factory/expected/generic/Shared1Expect.kt b/kmock-processor/src/test/resources/factory/expected/generic/Shared1Expect.kt index 54bce9e4..8915b89c 100644 --- a/kmock-processor/src/test/resources/factory/expected/generic/Shared1Expect.kt +++ b/kmock-processor/src/test/resources/factory/expected/generic/Shared1Expect.kt @@ -1,3 +1,5 @@ +@file:Suppress("UNUSED_PARAMETER", "UNUSED_EXPRESSION") + package generatorTest import factory.template.generic.Shared1 @@ -8,37 +10,34 @@ import kotlin.Comparable import kotlin.Suppress import tech.antibytes.kmock.KMockContract import tech.antibytes.kmock.KMockContract.Collector +import tech.antibytes.kmock.proxy.NoopCollector internal expect inline fun , K : Any, L> kmock( - verifier: KMockContract.Collector = Collector { _, _ -> Unit }, - @Suppress("UNUSED_PARAMETER") relaxed: Boolean = false, - @Suppress("UNUSED_PARAMETER") relaxUnitFun: Boolean = false, + verifier: KMockContract.Collector = NoopCollector, + relaxed: Boolean = false, + relaxUnitFun: Boolean = false, freeze: Boolean = true, - @Suppress("UNUSED_PARAMETER") templateType: kotlin.reflect.KClass> ): Mock where L : Any, L : Comparable internal expect inline fun , K : Any, L> kspy( - @Suppress("UNUSED_PARAMETER") spyOn: SpyOn, - verifier: KMockContract.Collector = Collector { _, _ -> Unit }, + spyOn: SpyOn, + verifier: KMockContract.Collector = NoopCollector, freeze: Boolean = true, - @Suppress("UNUSED_PARAMETER") templateType: kotlin.reflect.KClass> ): Mock where L : Any, L : Comparable internal expect inline fun , K : Any, L> kmock( - verifier: KMockContract.Collector = Collector { _, _ -> Unit }, - @Suppress("UNUSED_PARAMETER") relaxed: Boolean = false, - @Suppress("UNUSED_PARAMETER") relaxUnitFun: Boolean = false, + verifier: KMockContract.Collector = NoopCollector, + relaxed: Boolean = false, + relaxUnitFun: Boolean = false, freeze: Boolean = true, - @Suppress("UNUSED_PARAMETER") templateType: kotlin.reflect.KClass> ): Mock where L : Any, L : Comparable internal expect inline fun , K : Any, L> kspy( - @Suppress("UNUSED_PARAMETER") spyOn: SpyOn, - verifier: KMockContract.Collector = Collector { _, _ -> Unit }, + spyOn: SpyOn, + verifier: KMockContract.Collector = NoopCollector, freeze: Boolean = true, - @Suppress("UNUSED_PARAMETER") templateType: kotlin.reflect.KClass> ): Mock where L : Any, L : Comparable diff --git a/kmock-processor/src/test/resources/factory/expected/generic/Shared2Expect.kt b/kmock-processor/src/test/resources/factory/expected/generic/Shared2Expect.kt index 2c5e5cd5..dcbbff34 100644 --- a/kmock-processor/src/test/resources/factory/expected/generic/Shared2Expect.kt +++ b/kmock-processor/src/test/resources/factory/expected/generic/Shared2Expect.kt @@ -1,3 +1,5 @@ +@file:Suppress("UNUSED_PARAMETER", "UNUSED_EXPRESSION") + package generatorTest import factory.template.generic.Shared3 @@ -7,20 +9,19 @@ import kotlin.Comparable import kotlin.Suppress import tech.antibytes.kmock.KMockContract import tech.antibytes.kmock.KMockContract.Collector +import tech.antibytes.kmock.proxy.NoopCollector internal expect inline fun , K : Any, L> kmock( - verifier: KMockContract.Collector = Collector { _, _ -> Unit }, - @Suppress("UNUSED_PARAMETER") relaxed: Boolean = false, - @Suppress("UNUSED_PARAMETER") relaxUnitFun: Boolean = false, + verifier: KMockContract.Collector = NoopCollector, + relaxed: Boolean = false, + relaxUnitFun: Boolean = false, freeze: Boolean = true, - @Suppress("UNUSED_PARAMETER") templateType: kotlin.reflect.KClass> ): Mock where L : Any, L : Comparable internal expect inline fun , K : Any, L> kspy( - @Suppress("UNUSED_PARAMETER") spyOn: SpyOn, - verifier: KMockContract.Collector = Collector { _, _ -> Unit }, + spyOn: SpyOn, + verifier: KMockContract.Collector = NoopCollector, freeze: Boolean = true, - @Suppress("UNUSED_PARAMETER") templateType: kotlin.reflect.KClass> ): Mock where L : Any, L : Comparable diff --git a/kmock-processor/src/test/resources/factory/expected/generic/SharedActual.kt b/kmock-processor/src/test/resources/factory/expected/generic/SharedActual.kt index 60e53509..f580ac99 100644 --- a/kmock-processor/src/test/resources/factory/expected/generic/SharedActual.kt +++ b/kmock-processor/src/test/resources/factory/expected/generic/SharedActual.kt @@ -1,3 +1,5 @@ +@file:Suppress("UNUSED_PARAMETER", "UNUSED_EXPRESSION") + package generatorTest import factory.template.generic.Shared1 @@ -12,15 +14,15 @@ import tech.antibytes.kmock.KMockContract.Collector internal actual inline fun kmock( verifier: KMockContract.Collector, - @Suppress("UNUSED_PARAMETER") relaxed: Boolean, - @Suppress("UNUSED_PARAMETER") relaxUnitFun: Boolean, + relaxed: Boolean, + relaxUnitFun: Boolean, freeze: Boolean ): Mock = when (Mock::class) { else -> throw RuntimeException("Unknown Interface ${Mock::class.simpleName}.") } internal actual inline fun kspy( - @Suppress("UNUSED_PARAMETER") spyOn: SpyOn, + spyOn: SpyOn, verifier: KMockContract.Collector, freeze: Boolean ): Mock = when (Mock::class) { @@ -29,11 +31,10 @@ internal actual inline fun kspy( internal actual inline fun , K : Any, L> kmock( verifier: KMockContract.Collector, - @Suppress("UNUSED_PARAMETER") relaxed: Boolean, - @Suppress("UNUSED_PARAMETER") relaxUnitFun: Boolean, + relaxed: Boolean, + relaxUnitFun: Boolean, freeze: Boolean, - @Suppress("UNUSED_PARAMETER") - templateType: kotlin.reflect.KClass> +templateType: kotlin.reflect.KClass> ): Mock where L : Any, L : Comparable = when (Mock::class) { factory.template.generic.Shared1Mock::class -> factory.template.generic.Shared1Mock(verifier = verifier, relaxUnitFun = relaxUnitFun, freeze = freeze) as Mock @@ -41,22 +42,20 @@ internal actual inline fun , K : Any, L> kmock( } internal actual inline fun , K : Any, L> kspy( - @Suppress("UNUSED_PARAMETER") spyOn: SpyOn, + spyOn: SpyOn, verifier: KMockContract.Collector, freeze: Boolean, - @Suppress("UNUSED_PARAMETER") - templateType: kotlin.reflect.KClass> +templateType: kotlin.reflect.KClass> ): Mock where L : Any, L : Comparable = when (Mock::class) { else -> throw RuntimeException("Unknown Interface ${Mock::class.simpleName}.") } internal actual inline fun , K : Any, L> kmock( verifier: KMockContract.Collector, - @Suppress("UNUSED_PARAMETER") relaxed: Boolean, - @Suppress("UNUSED_PARAMETER") relaxUnitFun: Boolean, + relaxed: Boolean, + relaxUnitFun: Boolean, freeze: Boolean, - @Suppress("UNUSED_PARAMETER") - templateType: kotlin.reflect.KClass> +templateType: kotlin.reflect.KClass> ): Mock where L : Any, L : Comparable = when (Mock::class) { factory.template.generic.Shared2Mock::class -> factory.template.generic.Shared2Mock(verifier = verifier, relaxUnitFun = relaxUnitFun, freeze = freeze) as Mock @@ -64,22 +63,20 @@ internal actual inline fun , K : Any, L> kmock( } internal actual inline fun , K : Any, L> kspy( - @Suppress("UNUSED_PARAMETER") spyOn: SpyOn, + spyOn: SpyOn, verifier: KMockContract.Collector, freeze: Boolean, - @Suppress("UNUSED_PARAMETER") - templateType: kotlin.reflect.KClass> +templateType: kotlin.reflect.KClass> ): Mock where L : Any, L : Comparable = when (Mock::class) { else -> throw RuntimeException("Unknown Interface ${Mock::class.simpleName}.") } internal actual inline fun , K : Any, L> kmock( verifier: KMockContract.Collector, - @Suppress("UNUSED_PARAMETER") relaxed: Boolean, - @Suppress("UNUSED_PARAMETER") relaxUnitFun: Boolean, + relaxed: Boolean, + relaxUnitFun: Boolean, freeze: Boolean, - @Suppress("UNUSED_PARAMETER") - templateType: kotlin.reflect.KClass> +templateType: kotlin.reflect.KClass> ): Mock where L : Any, L : Comparable = when (Mock::class) { factory.template.generic.Shared3Mock::class -> factory.template.generic.Shared3Mock(verifier = verifier, relaxUnitFun = relaxUnitFun, freeze = freeze) as Mock @@ -87,11 +84,10 @@ internal actual inline fun , K : Any, L> kmock( } internal actual inline fun , K : Any, L> kspy( - @Suppress("UNUSED_PARAMETER") spyOn: SpyOn, + spyOn: SpyOn, verifier: KMockContract.Collector, freeze: Boolean, - @Suppress("UNUSED_PARAMETER") - templateType: kotlin.reflect.KClass> +templateType: kotlin.reflect.KClass> ): Mock where L : Any, L : Comparable = when (Mock::class) { else -> throw RuntimeException("Unknown Interface ${Mock::class.simpleName}.") } diff --git a/kmock-processor/src/test/resources/factory/expected/interfaze/Alias.kt b/kmock-processor/src/test/resources/factory/expected/interfaze/Alias.kt index c23b4679..298f6500 100644 --- a/kmock-processor/src/test/resources/factory/expected/interfaze/Alias.kt +++ b/kmock-processor/src/test/resources/factory/expected/interfaze/Alias.kt @@ -1,3 +1,5 @@ +@file:Suppress("UNUSED_PARAMETER", "UNUSED_EXPRESSION") + package generatorTest import factory.template.interfaze.Platform1 @@ -7,11 +9,12 @@ import kotlin.Comparable import kotlin.Suppress import tech.antibytes.kmock.KMockContract import tech.antibytes.kmock.KMockContract.Collector +import tech.antibytes.kmock.proxy.NoopCollector internal inline fun kmock( - verifier: KMockContract.Collector = Collector { _, _ -> Unit }, - @Suppress("UNUSED_PARAMETER") relaxed: Boolean = false, - @Suppress("UNUSED_PARAMETER") relaxUnitFun: Boolean = false, + verifier: KMockContract.Collector = NoopCollector, + relaxed: Boolean = false, + relaxUnitFun: Boolean = false, freeze: Boolean = true ): Mock = when (Mock::class) { factory.template.interfaze.Platform2::class -> factory.template.interfaze.Platform2Mock(verifier = @@ -28,8 +31,8 @@ internal inline fun kmock( } internal inline fun kspy( - @Suppress("UNUSED_PARAMETER") spyOn: SpyOn, - verifier: KMockContract.Collector = Collector { _, _ -> Unit }, + spyOn: SpyOn, + verifier: KMockContract.Collector = NoopCollector, freeze: Boolean = true ): Mock = when (Mock::class) { factory.template.interfaze.Platform2::class -> factory.template.interfaze.Platform2Mock(verifier = @@ -41,11 +44,10 @@ internal inline fun kspy( } internal inline fun , K : Any, L> kmock( - verifier: KMockContract.Collector = Collector { _, _ -> Unit }, - @Suppress("UNUSED_PARAMETER") relaxed: Boolean = false, - @Suppress("UNUSED_PARAMETER") relaxUnitFun: Boolean = false, + verifier: KMockContract.Collector = NoopCollector, + relaxed: Boolean = false, + relaxUnitFun: Boolean = false, freeze: Boolean = true, - @Suppress("UNUSED_PARAMETER") templateType: kotlin.reflect.KClass> ): Mock where L : Any, L : Comparable = when (Mock::class) { factory.template.interfaze.Platform1::class -> factory.template.interfaze.AliasPlatformMock, K : Any, L> kmock( } internal inline fun , K : Any, L> kspy( - @Suppress("UNUSED_PARAMETER") spyOn: SpyOn, - verifier: KMockContract.Collector = Collector { _, _ -> Unit }, + spyOn: SpyOn, + verifier: KMockContract.Collector = NoopCollector, freeze: Boolean = true, - @Suppress("UNUSED_PARAMETER") templateType: kotlin.reflect.KClass> ): Mock where L : Any, L : Comparable = when (Mock::class) { factory.template.interfaze.Platform1::class -> diff --git a/kmock-processor/src/test/resources/factory/expected/interfaze/CommonActual.kt b/kmock-processor/src/test/resources/factory/expected/interfaze/CommonActual.kt index fc48277f..10057f59 100644 --- a/kmock-processor/src/test/resources/factory/expected/interfaze/CommonActual.kt +++ b/kmock-processor/src/test/resources/factory/expected/interfaze/CommonActual.kt @@ -1,3 +1,5 @@ +@file:Suppress("UNUSED_PARAMETER", "UNUSED_EXPRESSION") + package generatorTest import factory.template.interfaze.Common1 @@ -10,8 +12,8 @@ import tech.antibytes.kmock.KMockContract.Collector internal actual inline fun kmock( verifier: KMockContract.Collector, - @Suppress("UNUSED_PARAMETER") relaxed: Boolean, - @Suppress("UNUSED_PARAMETER") relaxUnitFun: Boolean, + relaxed: Boolean, + relaxUnitFun: Boolean, freeze: Boolean ): Mock = when (Mock::class) { factory.template.interfaze.Common2Mock::class -> factory.template.interfaze.Common2Mock(verifier = @@ -22,7 +24,7 @@ internal actual inline fun kmock( } internal actual inline fun kspy( - @Suppress("UNUSED_PARAMETER") spyOn: SpyOn, + spyOn: SpyOn, verifier: KMockContract.Collector, freeze: Boolean ): Mock = when (Mock::class) { @@ -33,11 +35,10 @@ internal actual inline fun kspy( internal actual inline fun , K : Any, L> kmock( verifier: KMockContract.Collector, - @Suppress("UNUSED_PARAMETER") relaxed: Boolean, - @Suppress("UNUSED_PARAMETER") relaxUnitFun: Boolean, + relaxed: Boolean, + relaxUnitFun: Boolean, freeze: Boolean, - @Suppress("UNUSED_PARAMETER") - templateType: kotlin.reflect.KClass> +templateType: kotlin.reflect.KClass> ): Mock where L : Any, L : Comparable = when (Mock::class) { factory.template.interfaze.Common1Mock::class -> factory.template.interfaze.Common1Mock(verifier = verifier, relaxUnitFun = relaxUnitFun, freeze = freeze) as Mock @@ -45,11 +46,10 @@ internal actual inline fun , K : Any, L> kmock( } internal actual inline fun , K : Any, L> kspy( - @Suppress("UNUSED_PARAMETER") spyOn: SpyOn, + spyOn: SpyOn, verifier: KMockContract.Collector, freeze: Boolean, - @Suppress("UNUSED_PARAMETER") - templateType: kotlin.reflect.KClass> +templateType: kotlin.reflect.KClass> ): Mock where L : Any, L : Comparable = when (Mock::class) { factory.template.interfaze.Common1Mock::class -> factory.template.interfaze.Common1Mock(verifier = verifier, freeze = freeze, spyOn = spyOn as factory.template.interfaze.Common1) as Mock diff --git a/kmock-processor/src/test/resources/factory/expected/interfaze/CommonExpect.kt b/kmock-processor/src/test/resources/factory/expected/interfaze/CommonExpect.kt index 9197ce17..c8227764 100644 --- a/kmock-processor/src/test/resources/factory/expected/interfaze/CommonExpect.kt +++ b/kmock-processor/src/test/resources/factory/expected/interfaze/CommonExpect.kt @@ -1,3 +1,5 @@ +@file:Suppress("UNUSED_PARAMETER", "UNUSED_EXPRESSION") + package generatorTest import factory.template.interfaze.Common1 @@ -7,33 +9,32 @@ import kotlin.Comparable import kotlin.Suppress import tech.antibytes.kmock.KMockContract import tech.antibytes.kmock.KMockContract.Collector +import tech.antibytes.kmock.proxy.NoopCollector internal expect inline fun kmock( - verifier: KMockContract.Collector = Collector { _, _ -> Unit }, - @Suppress("UNUSED_PARAMETER") relaxed: Boolean = false, - @Suppress("UNUSED_PARAMETER") relaxUnitFun: Boolean = false, + verifier: KMockContract.Collector = NoopCollector, + relaxed: Boolean = false, + relaxUnitFun: Boolean = false, freeze: Boolean = true ): Mock internal expect inline fun kspy( - @Suppress("UNUSED_PARAMETER") spyOn: SpyOn, - verifier: KMockContract.Collector = Collector { _, _ -> Unit }, + spyOn: SpyOn, + verifier: KMockContract.Collector = NoopCollector, freeze: Boolean = true ): Mock internal expect inline fun , K : Any, L> kmock( - verifier: KMockContract.Collector = Collector { _, _ -> Unit }, - @Suppress("UNUSED_PARAMETER") relaxed: Boolean = false, - @Suppress("UNUSED_PARAMETER") relaxUnitFun: Boolean = false, + verifier: KMockContract.Collector = NoopCollector, + relaxed: Boolean = false, + relaxUnitFun: Boolean = false, freeze: Boolean = true, - @Suppress("UNUSED_PARAMETER") templateType: kotlin.reflect.KClass> ): Mock where L : Any, L : Comparable internal expect inline fun , K : Any, L> kspy( - @Suppress("UNUSED_PARAMETER") spyOn: SpyOn, - verifier: KMockContract.Collector = Collector { _, _ -> Unit }, + spyOn: SpyOn, + verifier: KMockContract.Collector = NoopCollector, freeze: Boolean = true, - @Suppress("UNUSED_PARAMETER") templateType: kotlin.reflect.KClass> ): Mock where L : Any, L : Comparable diff --git a/kmock-processor/src/test/resources/factory/expected/interfaze/NoSpy.kt b/kmock-processor/src/test/resources/factory/expected/interfaze/NoSpy.kt index f35da938..7f2a32c6 100644 --- a/kmock-processor/src/test/resources/factory/expected/interfaze/NoSpy.kt +++ b/kmock-processor/src/test/resources/factory/expected/interfaze/NoSpy.kt @@ -1,3 +1,5 @@ +@file:Suppress("UNUSED_PARAMETER", "UNUSED_EXPRESSION") + package generatorTest import factory.template.interfaze.Platform1 @@ -7,11 +9,12 @@ import kotlin.Comparable import kotlin.Suppress import tech.antibytes.kmock.KMockContract import tech.antibytes.kmock.KMockContract.Collector +import tech.antibytes.kmock.proxy.NoopCollector internal inline fun kmock( - verifier: KMockContract.Collector = Collector { _, _ -> Unit }, - @Suppress("UNUSED_PARAMETER") relaxed: Boolean = false, - @Suppress("UNUSED_PARAMETER") relaxUnitFun: Boolean = false, + verifier: KMockContract.Collector = NoopCollector, + relaxed: Boolean = false, + relaxUnitFun: Boolean = false, freeze: Boolean = true ): Mock = when (Mock::class) { factory.template.interfaze.Platform2::class -> factory.template.interfaze.Platform2Mock(verifier = @@ -28,19 +31,18 @@ internal inline fun kmock( } internal inline fun kspy( - @Suppress("UNUSED_PARAMETER") spyOn: SpyOn, - verifier: KMockContract.Collector = Collector { _, _ -> Unit }, + spyOn: SpyOn, + verifier: KMockContract.Collector = NoopCollector, freeze: Boolean = true ): Mock = when (Mock::class) { else -> throw RuntimeException("Unknown Interface ${Mock::class.simpleName}.") } internal inline fun , K : Any, L> kmock( - verifier: KMockContract.Collector = Collector { _, _ -> Unit }, - @Suppress("UNUSED_PARAMETER") relaxed: Boolean = false, - @Suppress("UNUSED_PARAMETER") relaxUnitFun: Boolean = false, + verifier: KMockContract.Collector = NoopCollector, + relaxed: Boolean = false, + relaxUnitFun: Boolean = false, freeze: Boolean = true, - @Suppress("UNUSED_PARAMETER") templateType: kotlin.reflect.KClass> ): Mock where L : Any, L : Comparable = when (Mock::class) { factory.template.interfaze.Platform1::class -> factory.template.interfaze.Platform1Mock, K : Any, L> kmock( } internal inline fun , K : Any, L> kspy( - @Suppress("UNUSED_PARAMETER") spyOn: SpyOn, - verifier: KMockContract.Collector = Collector { _, _ -> Unit }, + spyOn: SpyOn, + verifier: KMockContract.Collector = NoopCollector, freeze: Boolean = true, - @Suppress("UNUSED_PARAMETER") templateType: kotlin.reflect.KClass> ): Mock where L : Any, L : Comparable = when (Mock::class) { else -> throw RuntimeException("Unknown Interface ${Mock::class.simpleName}.") diff --git a/kmock-processor/src/test/resources/factory/expected/interfaze/Platform.kt b/kmock-processor/src/test/resources/factory/expected/interfaze/Platform.kt index 50ad4c86..4234cabb 100644 --- a/kmock-processor/src/test/resources/factory/expected/interfaze/Platform.kt +++ b/kmock-processor/src/test/resources/factory/expected/interfaze/Platform.kt @@ -1,3 +1,5 @@ +@file:Suppress("UNUSED_PARAMETER", "UNUSED_EXPRESSION") + package generatorTest import factory.template.interfaze.Platform1 @@ -7,11 +9,12 @@ import kotlin.Comparable import kotlin.Suppress import tech.antibytes.kmock.KMockContract import tech.antibytes.kmock.KMockContract.Collector +import tech.antibytes.kmock.proxy.NoopCollector internal inline fun kmock( - verifier: KMockContract.Collector = Collector { _, _ -> Unit }, - @Suppress("UNUSED_PARAMETER") relaxed: Boolean = false, - @Suppress("UNUSED_PARAMETER") relaxUnitFun: Boolean = false, + verifier: KMockContract.Collector = NoopCollector, + relaxed: Boolean = false, + relaxUnitFun: Boolean = false, freeze: Boolean = true ): Mock = when (Mock::class) { factory.template.interfaze.Platform2::class -> factory.template.interfaze.Platform2Mock(verifier = @@ -28,8 +31,8 @@ internal inline fun kmock( } internal inline fun kspy( - @Suppress("UNUSED_PARAMETER") spyOn: SpyOn, - verifier: KMockContract.Collector = Collector { _, _ -> Unit }, + spyOn: SpyOn, + verifier: KMockContract.Collector = NoopCollector, freeze: Boolean = true ): Mock = when (Mock::class) { factory.template.interfaze.Platform2::class -> factory.template.interfaze.Platform2Mock(verifier = @@ -41,11 +44,10 @@ internal inline fun kspy( } internal inline fun , K : Any, L> kmock( - verifier: KMockContract.Collector = Collector { _, _ -> Unit }, - @Suppress("UNUSED_PARAMETER") relaxed: Boolean = false, - @Suppress("UNUSED_PARAMETER") relaxUnitFun: Boolean = false, + verifier: KMockContract.Collector = NoopCollector, + relaxed: Boolean = false, + relaxUnitFun: Boolean = false, freeze: Boolean = true, - @Suppress("UNUSED_PARAMETER") templateType: kotlin.reflect.KClass> ): Mock where L : Any, L : Comparable = when (Mock::class) { factory.template.interfaze.Platform1::class -> factory.template.interfaze.Platform1Mock, K : Any, L> kmock( } internal inline fun , K : Any, L> kspy( - @Suppress("UNUSED_PARAMETER") spyOn: SpyOn, - verifier: KMockContract.Collector = Collector { _, _ -> Unit }, + spyOn: SpyOn, + verifier: KMockContract.Collector = NoopCollector, freeze: Boolean = true, - @Suppress("UNUSED_PARAMETER") templateType: kotlin.reflect.KClass> ): Mock where L : Any, L : Comparable = when (Mock::class) { factory.template.interfaze.Platform1::class -> factory.template.interfaze.Platform1Mock(verifier = diff --git a/kmock-processor/src/test/resources/factory/expected/interfaze/SharedActual.kt b/kmock-processor/src/test/resources/factory/expected/interfaze/SharedActual.kt index 69845790..1f2cd9ac 100644 --- a/kmock-processor/src/test/resources/factory/expected/interfaze/SharedActual.kt +++ b/kmock-processor/src/test/resources/factory/expected/interfaze/SharedActual.kt @@ -1,3 +1,5 @@ +@file:Suppress("UNUSED_PARAMETER", "UNUSED_EXPRESSION") + package generatorTest import factory.template.interfaze.Shared1 @@ -10,8 +12,8 @@ import tech.antibytes.kmock.KMockContract.Collector internal actual inline fun kmock( verifier: KMockContract.Collector, - @Suppress("UNUSED_PARAMETER") relaxed: Boolean, - @Suppress("UNUSED_PARAMETER") relaxUnitFun: Boolean, + relaxed: Boolean, + relaxUnitFun: Boolean, freeze: Boolean ): Mock = when (Mock::class) { factory.template.interfaze.Shared2Mock::class -> factory.template.interfaze.Shared2Mock(verifier = @@ -20,7 +22,7 @@ internal actual inline fun kmock( } internal actual inline fun kspy( - @Suppress("UNUSED_PARAMETER") spyOn: SpyOn, + spyOn: SpyOn, verifier: KMockContract.Collector, freeze: Boolean ): Mock = when (Mock::class) { @@ -31,11 +33,10 @@ internal actual inline fun kspy( internal actual inline fun , K : Any, L> kmock( verifier: KMockContract.Collector, - @Suppress("UNUSED_PARAMETER") relaxed: Boolean, - @Suppress("UNUSED_PARAMETER") relaxUnitFun: Boolean, + relaxed: Boolean, + relaxUnitFun: Boolean, freeze: Boolean, - @Suppress("UNUSED_PARAMETER") - templateType: kotlin.reflect.KClass> +templateType: kotlin.reflect.KClass> ): Mock where L : Any, L : Comparable = when (Mock::class) { factory.template.interfaze.Shared1Mock::class -> factory.template.interfaze.Shared1Mock(verifier = verifier, relaxUnitFun = relaxUnitFun, freeze = freeze) as Mock @@ -43,11 +44,10 @@ internal actual inline fun , K : Any, L> kmock( } internal actual inline fun , K : Any, L> kspy( - @Suppress("UNUSED_PARAMETER") spyOn: SpyOn, + spyOn: SpyOn, verifier: KMockContract.Collector, freeze: Boolean, - @Suppress("UNUSED_PARAMETER") - templateType: kotlin.reflect.KClass> +templateType: kotlin.reflect.KClass> ): Mock where L : Any, L : Comparable = when (Mock::class) { factory.template.interfaze.Shared1Mock::class -> factory.template.interfaze.Shared1Mock(verifier = verifier, freeze = freeze, spyOn = spyOn as factory.template.interfaze.Shared1) as Mock diff --git a/kmock-processor/src/test/resources/factory/expected/interfaze/SharedExpect.kt b/kmock-processor/src/test/resources/factory/expected/interfaze/SharedExpect.kt index 866c5655..14c40f11 100644 --- a/kmock-processor/src/test/resources/factory/expected/interfaze/SharedExpect.kt +++ b/kmock-processor/src/test/resources/factory/expected/interfaze/SharedExpect.kt @@ -1,3 +1,5 @@ +@file:Suppress("UNUSED_PARAMETER", "UNUSED_EXPRESSION") + package generatorTest import factory.template.interfaze.Shared1 @@ -7,20 +9,19 @@ import kotlin.Comparable import kotlin.Suppress import tech.antibytes.kmock.KMockContract import tech.antibytes.kmock.KMockContract.Collector +import tech.antibytes.kmock.proxy.NoopCollector internal expect inline fun , K : Any, L> kmock( - verifier: KMockContract.Collector = Collector { _, _ -> Unit }, - @Suppress("UNUSED_PARAMETER") relaxed: Boolean = false, - @Suppress("UNUSED_PARAMETER") relaxUnitFun: Boolean = false, + verifier: KMockContract.Collector = NoopCollector, + relaxed: Boolean = false, + relaxUnitFun: Boolean = false, freeze: Boolean = true, - @Suppress("UNUSED_PARAMETER") templateType: kotlin.reflect.KClass> ): Mock where L : Any, L : Comparable internal expect inline fun , K : Any, L> kspy( - @Suppress("UNUSED_PARAMETER") spyOn: SpyOn, - verifier: KMockContract.Collector = Collector { _, _ -> Unit }, + spyOn: SpyOn, + verifier: KMockContract.Collector = NoopCollector, freeze: Boolean = true, - @Suppress("UNUSED_PARAMETER") templateType: kotlin.reflect.KClass> ): Mock where L : Any, L : Comparable diff --git a/kmock-processor/src/test/resources/factory/expected/regular/CommonActual.kt b/kmock-processor/src/test/resources/factory/expected/regular/CommonActual.kt index b70f9fd6..b03e1391 100644 --- a/kmock-processor/src/test/resources/factory/expected/regular/CommonActual.kt +++ b/kmock-processor/src/test/resources/factory/expected/regular/CommonActual.kt @@ -1,3 +1,5 @@ +@file:Suppress("UNUSED_PARAMETER", "UNUSED_EXPRESSION") + package generatorTest import kotlin.Boolean @@ -7,8 +9,8 @@ import tech.antibytes.kmock.KMockContract.Collector internal actual inline fun kmock( verifier: KMockContract.Collector, - @Suppress("UNUSED_PARAMETER") relaxed: Boolean, - @Suppress("UNUSED_PARAMETER") relaxUnitFun: Boolean, + relaxed: Boolean, + relaxUnitFun: Boolean, freeze: Boolean ): Mock = when (Mock::class) { factory.template.regular.CommonMock::class -> factory.template.regular.CommonMock(verifier = @@ -17,7 +19,7 @@ internal actual inline fun kmock( } internal actual inline fun kspy( - @Suppress("UNUSED_PARAMETER") spyOn: SpyOn, + spyOn: SpyOn, verifier: KMockContract.Collector, freeze: Boolean ): Mock = when (Mock::class) { diff --git a/kmock-processor/src/test/resources/factory/expected/regular/CommonExpect.kt b/kmock-processor/src/test/resources/factory/expected/regular/CommonExpect.kt index ee4300d0..5d597298 100644 --- a/kmock-processor/src/test/resources/factory/expected/regular/CommonExpect.kt +++ b/kmock-processor/src/test/resources/factory/expected/regular/CommonExpect.kt @@ -1,19 +1,22 @@ +@file:Suppress("UNUSED_PARAMETER", "UNUSED_EXPRESSION") + package generatorTest import kotlin.Boolean import kotlin.Suppress import tech.antibytes.kmock.KMockContract import tech.antibytes.kmock.KMockContract.Collector +import tech.antibytes.kmock.proxy.NoopCollector internal expect inline fun kmock( - verifier: KMockContract.Collector = Collector { _, _ -> Unit }, - @Suppress("UNUSED_PARAMETER") relaxed: Boolean = false, - @Suppress("UNUSED_PARAMETER") relaxUnitFun: Boolean = false, + verifier: KMockContract.Collector = NoopCollector, + relaxed: Boolean = false, + relaxUnitFun: Boolean = false, freeze: Boolean = true ): Mock internal expect inline fun kspy( - @Suppress("UNUSED_PARAMETER") spyOn: SpyOn, - verifier: KMockContract.Collector = Collector { _, _ -> Unit }, + spyOn: SpyOn, + verifier: KMockContract.Collector = NoopCollector, freeze: Boolean = true ): Mock diff --git a/kmock-processor/src/test/resources/factory/expected/regular/Platform.kt b/kmock-processor/src/test/resources/factory/expected/regular/Platform.kt index 5dcd3231..65ffdfb6 100644 --- a/kmock-processor/src/test/resources/factory/expected/regular/Platform.kt +++ b/kmock-processor/src/test/resources/factory/expected/regular/Platform.kt @@ -1,14 +1,17 @@ +@file:Suppress("UNUSED_PARAMETER", "UNUSED_EXPRESSION") + package generatorTest import kotlin.Boolean import kotlin.Suppress import tech.antibytes.kmock.KMockContract import tech.antibytes.kmock.KMockContract.Collector +import tech.antibytes.kmock.proxy.NoopCollector internal inline fun kmock( - verifier: KMockContract.Collector = Collector { _, _ -> Unit }, - @Suppress("UNUSED_PARAMETER") relaxed: Boolean = false, - @Suppress("UNUSED_PARAMETER") relaxUnitFun: Boolean = false, + verifier: KMockContract.Collector = NoopCollector, + relaxed: Boolean = false, + relaxUnitFun: Boolean = false, freeze: Boolean = true ): Mock = when (Mock::class) { factory.template.regular.PlatformMock::class -> factory.template.regular.PlatformMock(verifier = @@ -17,8 +20,8 @@ internal inline fun kmock( } internal inline fun kspy( - @Suppress("UNUSED_PARAMETER") spyOn: SpyOn, - verifier: KMockContract.Collector = Collector { _, _ -> Unit }, + spyOn: SpyOn, + verifier: KMockContract.Collector = NoopCollector, freeze: Boolean = true ): Mock = when (Mock::class) { else -> throw RuntimeException("Unknown Interface ${Mock::class.simpleName}.") diff --git a/kmock-processor/src/test/resources/factory/expected/relaxed/CommonActual.kt b/kmock-processor/src/test/resources/factory/expected/relaxed/CommonActual.kt index d9f5b3c3..78407ce7 100644 --- a/kmock-processor/src/test/resources/factory/expected/relaxed/CommonActual.kt +++ b/kmock-processor/src/test/resources/factory/expected/relaxed/CommonActual.kt @@ -1,3 +1,5 @@ +@file:Suppress("UNUSED_PARAMETER", "UNUSED_EXPRESSION") + package generatorTest import kotlin.Boolean @@ -7,8 +9,8 @@ import tech.antibytes.kmock.KMockContract.Collector internal actual inline fun kmock( verifier: KMockContract.Collector, - @Suppress("UNUSED_PARAMETER") relaxed: Boolean, - @Suppress("UNUSED_PARAMETER") relaxUnitFun: Boolean, + relaxed: Boolean, + relaxUnitFun: Boolean, freeze: Boolean ): Mock = when (Mock::class) { factory.template.relaxed.CommonMock::class -> factory.template.relaxed.CommonMock(verifier = @@ -17,7 +19,7 @@ internal actual inline fun kmock( } internal actual inline fun kspy( - @Suppress("UNUSED_PARAMETER") spyOn: SpyOn, + spyOn: SpyOn, verifier: KMockContract.Collector, freeze: Boolean ): Mock = when (Mock::class) { diff --git a/kmock-processor/src/test/resources/factory/expected/relaxed/CommonExpect.kt b/kmock-processor/src/test/resources/factory/expected/relaxed/CommonExpect.kt index ee4300d0..5d597298 100644 --- a/kmock-processor/src/test/resources/factory/expected/relaxed/CommonExpect.kt +++ b/kmock-processor/src/test/resources/factory/expected/relaxed/CommonExpect.kt @@ -1,19 +1,22 @@ +@file:Suppress("UNUSED_PARAMETER", "UNUSED_EXPRESSION") + package generatorTest import kotlin.Boolean import kotlin.Suppress import tech.antibytes.kmock.KMockContract import tech.antibytes.kmock.KMockContract.Collector +import tech.antibytes.kmock.proxy.NoopCollector internal expect inline fun kmock( - verifier: KMockContract.Collector = Collector { _, _ -> Unit }, - @Suppress("UNUSED_PARAMETER") relaxed: Boolean = false, - @Suppress("UNUSED_PARAMETER") relaxUnitFun: Boolean = false, + verifier: KMockContract.Collector = NoopCollector, + relaxed: Boolean = false, + relaxUnitFun: Boolean = false, freeze: Boolean = true ): Mock internal expect inline fun kspy( - @Suppress("UNUSED_PARAMETER") spyOn: SpyOn, - verifier: KMockContract.Collector = Collector { _, _ -> Unit }, + spyOn: SpyOn, + verifier: KMockContract.Collector = NoopCollector, freeze: Boolean = true ): Mock diff --git a/kmock-processor/src/test/resources/factory/expected/relaxed/Platform.kt b/kmock-processor/src/test/resources/factory/expected/relaxed/Platform.kt index d8f4441f..5fdb4404 100644 --- a/kmock-processor/src/test/resources/factory/expected/relaxed/Platform.kt +++ b/kmock-processor/src/test/resources/factory/expected/relaxed/Platform.kt @@ -1,14 +1,17 @@ +@file:Suppress("UNUSED_PARAMETER", "UNUSED_EXPRESSION") + package generatorTest import kotlin.Boolean import kotlin.Suppress import tech.antibytes.kmock.KMockContract import tech.antibytes.kmock.KMockContract.Collector +import tech.antibytes.kmock.proxy.NoopCollector internal inline fun kmock( - verifier: KMockContract.Collector = Collector { _, _ -> Unit }, - @Suppress("UNUSED_PARAMETER") relaxed: Boolean = false, - @Suppress("UNUSED_PARAMETER") relaxUnitFun: Boolean = false, + verifier: KMockContract.Collector = NoopCollector, + relaxed: Boolean = false, + relaxUnitFun: Boolean = false, freeze: Boolean = true ): Mock = when (Mock::class) { factory.template.relaxed.PlatformMock::class -> factory.template.relaxed.PlatformMock(verifier = @@ -17,8 +20,8 @@ internal inline fun kmock( } internal inline fun kspy( - @Suppress("UNUSED_PARAMETER") spyOn: SpyOn, - verifier: KMockContract.Collector = Collector { _, _ -> Unit }, + spyOn: SpyOn, + verifier: KMockContract.Collector = NoopCollector, freeze: Boolean = true ): Mock = when (Mock::class) { else -> throw RuntimeException("Unknown Interface ${Mock::class.simpleName}.") diff --git a/kmock-processor/src/test/resources/factory/expected/spy/CommonActual.kt b/kmock-processor/src/test/resources/factory/expected/spy/CommonActual.kt index 7390f299..d5aeced3 100644 --- a/kmock-processor/src/test/resources/factory/expected/spy/CommonActual.kt +++ b/kmock-processor/src/test/resources/factory/expected/spy/CommonActual.kt @@ -1,3 +1,5 @@ +@file:Suppress("UNUSED_PARAMETER", "UNUSED_EXPRESSION") + package generatorTest import factory.template.spy.Common1 @@ -10,8 +12,8 @@ import tech.antibytes.kmock.KMockContract.Collector internal actual inline fun kmock( verifier: KMockContract.Collector, - @Suppress("UNUSED_PARAMETER") relaxed: Boolean, - @Suppress("UNUSED_PARAMETER") relaxUnitFun: Boolean, + relaxed: Boolean, + relaxUnitFun: Boolean, freeze: Boolean ): Mock = when (Mock::class) { factory.template.spy.Common2Mock::class -> factory.template.spy.Common2Mock(verifier = verifier, @@ -20,7 +22,7 @@ internal actual inline fun kmock( } internal actual inline fun kspy( - @Suppress("UNUSED_PARAMETER") spyOn: SpyOn, + spyOn: SpyOn, verifier: KMockContract.Collector, freeze: Boolean ): Mock = when (Mock::class) { @@ -31,11 +33,10 @@ internal actual inline fun kspy( internal actual inline fun , K : Any, L> kmock( verifier: KMockContract.Collector, - @Suppress("UNUSED_PARAMETER") relaxed: Boolean, - @Suppress("UNUSED_PARAMETER") relaxUnitFun: Boolean, + relaxed: Boolean, + relaxUnitFun: Boolean, freeze: Boolean, - @Suppress("UNUSED_PARAMETER") templateType: kotlin.reflect.KClass> + templateType: kotlin.reflect.KClass> ): Mock where L : Any, L : Comparable = when (Mock::class) { factory.template.spy.Common1Mock::class -> factory.template.spy.Common1Mock(verifier = verifier, relaxUnitFun = relaxUnitFun, freeze = freeze) as Mock @@ -43,11 +44,10 @@ internal actual inline fun , K : Any, L> kmock( } internal actual inline fun , K : Any, L> kspy( - @Suppress("UNUSED_PARAMETER") spyOn: SpyOn, + spyOn: SpyOn, verifier: KMockContract.Collector, freeze: Boolean, - @Suppress("UNUSED_PARAMETER") templateType: kotlin.reflect.KClass> + templateType: kotlin.reflect.KClass> ): Mock where L : Any, L : Comparable = when (Mock::class) { factory.template.spy.Common1Mock::class -> factory.template.spy.Common1Mock(verifier = verifier, freeze = freeze, spyOn = spyOn as factory.template.spy.Common1) as Mock diff --git a/kmock-processor/src/test/resources/factory/expected/spy/CommonExpect.kt b/kmock-processor/src/test/resources/factory/expected/spy/CommonExpect.kt index 989b9c8d..c8f249a8 100644 --- a/kmock-processor/src/test/resources/factory/expected/spy/CommonExpect.kt +++ b/kmock-processor/src/test/resources/factory/expected/spy/CommonExpect.kt @@ -1,3 +1,5 @@ +@file:Suppress("UNUSED_PARAMETER", "UNUSED_EXPRESSION") + package generatorTest import factory.template.spy.Common1 @@ -7,33 +9,32 @@ import kotlin.Comparable import kotlin.Suppress import tech.antibytes.kmock.KMockContract import tech.antibytes.kmock.KMockContract.Collector +import tech.antibytes.kmock.proxy.NoopCollector internal expect inline fun kmock( - verifier: KMockContract.Collector = Collector { _, _ -> Unit }, - @Suppress("UNUSED_PARAMETER") relaxed: Boolean = false, - @Suppress("UNUSED_PARAMETER") relaxUnitFun: Boolean = false, + verifier: KMockContract.Collector = NoopCollector, + relaxed: Boolean = false, + relaxUnitFun: Boolean = false, freeze: Boolean = true ): Mock internal expect inline fun kspy( - @Suppress("UNUSED_PARAMETER") spyOn: SpyOn, - verifier: KMockContract.Collector = Collector { _, _ -> Unit }, + spyOn: SpyOn, + verifier: KMockContract.Collector = NoopCollector, freeze: Boolean = true ): Mock internal expect inline fun , K : Any, L> kmock( - verifier: KMockContract.Collector = Collector { _, _ -> Unit }, - @Suppress("UNUSED_PARAMETER") relaxed: Boolean = false, - @Suppress("UNUSED_PARAMETER") relaxUnitFun: Boolean = false, + verifier: KMockContract.Collector = NoopCollector, + relaxed: Boolean = false, + relaxUnitFun: Boolean = false, freeze: Boolean = true, - @Suppress("UNUSED_PARAMETER") templateType: kotlin.reflect.KClass> + templateType: kotlin.reflect.KClass> ): Mock where L : Any, L : Comparable internal expect inline fun , K : Any, L> kspy( - @Suppress("UNUSED_PARAMETER") spyOn: SpyOn, - verifier: KMockContract.Collector = Collector { _, _ -> Unit }, + spyOn: SpyOn, + verifier: KMockContract.Collector = NoopCollector, freeze: Boolean = true, - @Suppress("UNUSED_PARAMETER") templateType: kotlin.reflect.KClass> + templateType: kotlin.reflect.KClass> ): Mock where L : Any, L : Comparable diff --git a/kmock-processor/src/test/resources/factory/expected/spy/Platform.kt b/kmock-processor/src/test/resources/factory/expected/spy/Platform.kt index 421adafd..8b99be1f 100644 --- a/kmock-processor/src/test/resources/factory/expected/spy/Platform.kt +++ b/kmock-processor/src/test/resources/factory/expected/spy/Platform.kt @@ -1,3 +1,5 @@ +@file:Suppress("UNUSED_PARAMETER", "UNUSED_EXPRESSION") + package generatorTest import factory.template.spy.Platform1 @@ -7,11 +9,12 @@ import kotlin.Comparable import kotlin.Suppress import tech.antibytes.kmock.KMockContract import tech.antibytes.kmock.KMockContract.Collector +import tech.antibytes.kmock.proxy.NoopCollector internal inline fun kmock( - verifier: KMockContract.Collector = Collector { _, _ -> Unit }, - @Suppress("UNUSED_PARAMETER") relaxed: Boolean = false, - @Suppress("UNUSED_PARAMETER") relaxUnitFun: Boolean = false, + verifier: KMockContract.Collector = NoopCollector, + relaxed: Boolean = false, + relaxUnitFun: Boolean = false, freeze: Boolean = true ): Mock = when (Mock::class) { factory.template.spy.Platform2Mock::class -> factory.template.spy.Platform2Mock(verifier = @@ -22,8 +25,8 @@ internal inline fun kmock( } internal inline fun kspy( - @Suppress("UNUSED_PARAMETER") spyOn: SpyOn, - verifier: KMockContract.Collector = Collector { _, _ -> Unit }, + spyOn: SpyOn, + verifier: KMockContract.Collector = NoopCollector, freeze: Boolean = true ): Mock = when (Mock::class) { factory.template.spy.Platform2Mock::class -> factory.template.spy.Platform2Mock(verifier = @@ -32,11 +35,10 @@ internal inline fun kspy( } internal inline fun , K : Any, L> kmock( - verifier: KMockContract.Collector = Collector { _, _ -> Unit }, - @Suppress("UNUSED_PARAMETER") relaxed: Boolean = false, - @Suppress("UNUSED_PARAMETER") relaxUnitFun: Boolean = false, + verifier: KMockContract.Collector = NoopCollector, + relaxed: Boolean = false, + relaxUnitFun: Boolean = false, freeze: Boolean = true, - @Suppress("UNUSED_PARAMETER") templateType: kotlin.reflect.KClass> ): Mock where L : Any, L : Comparable = when (Mock::class) { factory.template.spy.Platform1Mock::class -> factory.template.spy.Platform1Mock(verifier = @@ -45,10 +47,9 @@ internal inline fun , K : Any, L> kmock( } internal inline fun , K : Any, L> kspy( - @Suppress("UNUSED_PARAMETER") spyOn: SpyOn, - verifier: KMockContract.Collector = Collector { _, _ -> Unit }, + spyOn: SpyOn, + verifier: KMockContract.Collector = NoopCollector, freeze: Boolean = true, - @Suppress("UNUSED_PARAMETER") templateType: kotlin.reflect.KClass> ): Mock where L : Any, L : Comparable = when (Mock::class) { factory.template.spy.Platform1Mock::class -> factory.template.spy.Platform1Mock(verifier = diff --git a/kmock-processor/src/test/resources/factory/expected/spy/SharedActual.kt b/kmock-processor/src/test/resources/factory/expected/spy/SharedActual.kt index d19ed56a..e72b50ea 100644 --- a/kmock-processor/src/test/resources/factory/expected/spy/SharedActual.kt +++ b/kmock-processor/src/test/resources/factory/expected/spy/SharedActual.kt @@ -1,3 +1,5 @@ +@file:Suppress("UNUSED_PARAMETER", "UNUSED_EXPRESSION") + package generatorTest import factory.template.spy.Shared1 @@ -10,8 +12,8 @@ import tech.antibytes.kmock.KMockContract.Collector internal actual inline fun kmock( verifier: KMockContract.Collector, - @Suppress("UNUSED_PARAMETER") relaxed: Boolean, - @Suppress("UNUSED_PARAMETER") relaxUnitFun: Boolean, + relaxed: Boolean, + relaxUnitFun: Boolean, freeze: Boolean ): Mock = when (Mock::class) { factory.template.spy.Shared2Mock::class -> factory.template.spy.Shared2Mock(verifier = verifier, @@ -20,7 +22,7 @@ internal actual inline fun kmock( } internal actual inline fun kspy( - @Suppress("UNUSED_PARAMETER") spyOn: SpyOn, + spyOn: SpyOn, verifier: KMockContract.Collector, freeze: Boolean ): Mock = when (Mock::class) { @@ -31,11 +33,10 @@ internal actual inline fun kspy( internal actual inline fun , K : Any, L> kmock( verifier: KMockContract.Collector, - @Suppress("UNUSED_PARAMETER") relaxed: Boolean, - @Suppress("UNUSED_PARAMETER") relaxUnitFun: Boolean, + relaxed: Boolean, + relaxUnitFun: Boolean, freeze: Boolean, - @Suppress("UNUSED_PARAMETER") templateType: kotlin.reflect.KClass> + templateType: kotlin.reflect.KClass> ): Mock where L : Any, L : Comparable = when (Mock::class) { factory.template.spy.Shared1Mock::class -> factory.template.spy.Shared1Mock(verifier = verifier, relaxUnitFun = relaxUnitFun, freeze = freeze) as Mock @@ -43,11 +44,10 @@ internal actual inline fun , K : Any, L> kmock( } internal actual inline fun , K : Any, L> kspy( - @Suppress("UNUSED_PARAMETER") spyOn: SpyOn, + spyOn: SpyOn, verifier: KMockContract.Collector, freeze: Boolean, - @Suppress("UNUSED_PARAMETER") templateType: kotlin.reflect.KClass> + templateType: kotlin.reflect.KClass> ): Mock where L : Any, L : Comparable = when (Mock::class) { factory.template.spy.Shared1Mock::class -> factory.template.spy.Shared1Mock(verifier = verifier, freeze = freeze, spyOn = spyOn as factory.template.spy.Shared1) as Mock diff --git a/kmock-processor/src/test/resources/factory/expected/spy/SharedExpect.kt b/kmock-processor/src/test/resources/factory/expected/spy/SharedExpect.kt index b88fc6a0..23d31a54 100644 --- a/kmock-processor/src/test/resources/factory/expected/spy/SharedExpect.kt +++ b/kmock-processor/src/test/resources/factory/expected/spy/SharedExpect.kt @@ -1,3 +1,5 @@ +@file:Suppress("UNUSED_PARAMETER", "UNUSED_EXPRESSION") + package generatorTest import factory.template.spy.Shared1 @@ -7,20 +9,19 @@ import kotlin.Comparable import kotlin.Suppress import tech.antibytes.kmock.KMockContract import tech.antibytes.kmock.KMockContract.Collector +import tech.antibytes.kmock.proxy.NoopCollector internal expect inline fun , K : Any, L> kmock( - verifier: KMockContract.Collector = Collector { _, _ -> Unit }, - @Suppress("UNUSED_PARAMETER") relaxed: Boolean = false, - @Suppress("UNUSED_PARAMETER") relaxUnitFun: Boolean = false, + verifier: KMockContract.Collector = NoopCollector, + relaxed: Boolean = false, + relaxUnitFun: Boolean = false, freeze: Boolean = true, - @Suppress("UNUSED_PARAMETER") templateType: kotlin.reflect.KClass> + templateType: kotlin.reflect.KClass> ): Mock where L : Any, L : Comparable internal expect inline fun , K : Any, L> kspy( - @Suppress("UNUSED_PARAMETER") spyOn: SpyOn, - verifier: KMockContract.Collector = Collector { _, _ -> Unit }, + spyOn: SpyOn, + verifier: KMockContract.Collector = NoopCollector, freeze: Boolean = true, - @Suppress("UNUSED_PARAMETER") templateType: kotlin.reflect.KClass> + templateType: kotlin.reflect.KClass> ): Mock where L : Any, L : Comparable