Skip to content

Commit 3487901

Browse files
committed
Update tests
1 parent ba6ceff commit 3487901

File tree

9 files changed

+108
-97
lines changed

9 files changed

+108
-97
lines changed

tests/compiler-plugin-tests/src/test/kotlin/kotlinx/rpc/codegen/test/runners/AbstractBoxTest.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2023-2024 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license.
2+
* Copyright 2023-2025 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license.
33
*/
44

55
package kotlinx.rpc.codegen.test.runners
@@ -36,7 +36,7 @@ open class AbstractBoxTest : BaseTestRunner(), RunnerWithTargetBackendForTestGen
3636
override val targetBackend: TargetBackend
3737
get() = TargetBackend.JVM_IR
3838

39-
override fun TestConfigurationBuilder.configuration() {
39+
override fun configure(builder: TestConfigurationBuilder) = with(builder) {
4040
configureFirParser(FirParser.LightTree)
4141

4242
defaultDirectives {

tests/compiler-plugin-tests/src/test/kotlin/kotlinx/rpc/codegen/test/runners/AbstractDiagnosticTest.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2023-2024 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license.
2+
* Copyright 2023-2025 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license.
33
*/
44

55
package kotlinx.rpc.codegen.test.runners
@@ -11,7 +11,7 @@ import org.jetbrains.kotlin.test.services.EnvironmentBasedStandardLibrariesPathP
1111
import org.jetbrains.kotlin.test.services.KotlinStandardLibrariesPathProvider
1212

1313
abstract class AbstractDiagnosticTest : BaseTestRunner() {
14-
override fun TestConfigurationBuilder.configuration() {
14+
override fun configure(builder: TestConfigurationBuilder) = with(builder) {
1515
commonFirWithPluginFrontendConfiguration()
1616
configureFirParser(FirParser.LightTree)
1717
}

tests/compiler-plugin-tests/src/test/kotlin/kotlinx/rpc/codegen/test/runners/BaseTestRunner.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2023-2024 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license.
2+
* Copyright 2023-2025 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license.
33
*/
44

55
package kotlinx.rpc.codegen.test.runners
@@ -8,11 +8,11 @@ import kotlinx.rpc.codegen.test.services.ExtensionRegistrarConfigurator
88
import kotlinx.rpc.codegen.test.services.RpcCompileClasspathProvider
99
import kotlinx.rpc.codegen.test.services.RpcRuntimeClasspathProvider
1010
import org.jetbrains.kotlin.test.builders.TestConfigurationBuilder
11+
import org.jetbrains.kotlin.test.configuration.baseFirDiagnosticTestConfiguration
1112
import org.jetbrains.kotlin.test.directives.FirDiagnosticsDirectives
1213
import org.jetbrains.kotlin.test.directives.JvmEnvironmentConfigurationDirectives
1314
import org.jetbrains.kotlin.test.initIdeaConfiguration
1415
import org.jetbrains.kotlin.test.runners.AbstractKotlinCompilerTest
15-
import org.jetbrains.kotlin.test.runners.baseFirDiagnosticTestConfiguration
1616
import org.jetbrains.kotlin.test.services.EnvironmentBasedStandardLibrariesPathProvider
1717
import org.jetbrains.kotlin.test.services.KotlinStandardLibrariesPathProvider
1818
import org.junit.jupiter.api.BeforeAll

tests/compiler-plugin-tests/src/testData/box/customParameterTypes.fir.ir.txt

Lines changed: 26 additions & 26 deletions
Large diffs are not rendered by default.

tests/compiler-plugin-tests/src/testData/box/fields.fir.ir.txt

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -287,7 +287,7 @@ FILE fqName:<root> fileName:/fields.kt
287287
CONSTRUCTOR visibility:private <> () returnType:<root>.BoxService.$rpcServiceStub.Companion [primary]
288288
BLOCK_BODY
289289
DELEGATING_CONSTRUCTOR_CALL 'public constructor <init> () declared in kotlin.Any'
290-
INSTANCE_INITIALIZER_CALL classDescriptor='CLASS GENERATED[kotlinx.rpc.codegen.FirRpcServiceStubCompanionObject] OBJECT name:Companion modality:FINAL visibility:public [companion] superTypes:[kotlinx.rpc.descriptor.RpcServiceDescriptor<<root>.BoxService>]'
290+
INSTANCE_INITIALIZER_CALL classDescriptor='CLASS GENERATED[kotlinx.rpc.codegen.FirRpcServiceStubCompanionObject] OBJECT name:Companion modality:FINAL visibility:public [companion] superTypes:[kotlinx.rpc.descriptor.RpcServiceDescriptor<<root>.BoxService>]' type=kotlin.Unit
291291
FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean [fake_override,operator]
292292
overridden:
293293
public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlinx.rpc.descriptor.RpcServiceDescriptor
@@ -345,7 +345,7 @@ FILE fqName:<root> fileName:/fields.kt
345345
VALUE_PARAMETER name:__rpc_client index:1 type:kotlinx.rpc.RpcClient
346346
BLOCK_BODY
347347
DELEGATING_CONSTRUCTOR_CALL 'public constructor <init> () declared in kotlin.Any'
348-
INSTANCE_INITIALIZER_CALL classDescriptor='CLASS GENERATED[kotlinx.rpc.codegen.RpcGeneratedStubKey] CLASS name:$rpcServiceStub modality:FINAL visibility:public superTypes:[<root>.BoxService]'
348+
INSTANCE_INITIALIZER_CALL classDescriptor='CLASS GENERATED[kotlinx.rpc.codegen.RpcGeneratedStubKey] CLASS name:$rpcServiceStub modality:FINAL visibility:public superTypes:[<root>.BoxService]' type=kotlin.Unit
349349
FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean [fake_override,operator]
350350
overridden:
351351
public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in <root>.BoxService
@@ -417,7 +417,7 @@ FILE fqName:<root> fileName:/fields.kt
417417
$receiver: CALL 'public abstract fun <get-plainFlow> (): kotlinx.coroutines.flow.Flow<kotlin.String> declared in <root>.BoxService' type=kotlinx.coroutines.flow.Flow<kotlin.String> origin=GET_PROPERTY
418418
$this: CALL 'public final fun withService <T> (): T of kotlinx.rpc.withService declared in kotlinx.rpc' type=<root>.BoxService origin=null
419419
<T>: <root>.BoxService
420-
$receiver: GET_OBJECT 'CLASS OBJECT name:TestRpcClient modality:FINAL visibility:public superTypes:[kotlinx.rpc.RpcClient]' type=kotlinx.rpc.codegen.test.TestRpcClient
420+
$receiver: GET_OBJECT 'CLASS IR_EXTERNAL_DECLARATION_STUB OBJECT name:TestRpcClient modality:FINAL visibility:public superTypes:[kotlinx.rpc.RpcClient]' type=kotlinx.rpc.codegen.test.TestRpcClient
421421
VAR name:sharedFlow type:kotlin.collections.List<kotlin.String> [val]
422422
CALL 'public final fun toList <T> (destination: kotlin.collections.MutableList<T of kotlinx.coroutines.flow.toList>): kotlin.collections.List<T of kotlinx.coroutines.flow.toList> declared in kotlinx.coroutines.flow' type=kotlin.collections.List<kotlin.String> origin=null
423423
<T>: kotlin.String
@@ -426,14 +426,14 @@ FILE fqName:<root> fileName:/fields.kt
426426
$receiver: CALL 'public abstract fun <get-sharedFlow> (): kotlinx.coroutines.flow.SharedFlow<kotlin.String> declared in <root>.BoxService' type=kotlinx.coroutines.flow.SharedFlow<kotlin.String> origin=GET_PROPERTY
427427
$this: CALL 'public final fun withService <T> (): T of kotlinx.rpc.withService declared in kotlinx.rpc' type=<root>.BoxService origin=null
428428
<T>: <root>.BoxService
429-
$receiver: GET_OBJECT 'CLASS OBJECT name:TestRpcClient modality:FINAL visibility:public superTypes:[kotlinx.rpc.RpcClient]' type=kotlinx.rpc.codegen.test.TestRpcClient
429+
$receiver: GET_OBJECT 'CLASS IR_EXTERNAL_DECLARATION_STUB OBJECT name:TestRpcClient modality:FINAL visibility:public superTypes:[kotlinx.rpc.RpcClient]' type=kotlinx.rpc.codegen.test.TestRpcClient
430430
count: CONST Int type=kotlin.Int value=1
431431
VAR name:stateFlow type:kotlin.String [val]
432432
CALL 'public abstract fun <get-value> (): T of kotlinx.coroutines.flow.StateFlow declared in kotlinx.coroutines.flow.StateFlow' type=kotlin.String origin=GET_PROPERTY
433433
$this: CALL 'public abstract fun <get-stateFlow> (): kotlinx.coroutines.flow.StateFlow<kotlin.String> declared in <root>.BoxService' type=kotlinx.coroutines.flow.StateFlow<kotlin.String> origin=GET_PROPERTY
434434
$this: CALL 'public final fun withService <T> (): T of kotlinx.rpc.withService declared in kotlinx.rpc' type=<root>.BoxService origin=null
435435
<T>: <root>.BoxService
436-
$receiver: GET_OBJECT 'CLASS OBJECT name:TestRpcClient modality:FINAL visibility:public superTypes:[kotlinx.rpc.RpcClient]' type=kotlinx.rpc.codegen.test.TestRpcClient
436+
$receiver: GET_OBJECT 'CLASS IR_EXTERNAL_DECLARATION_STUB OBJECT name:TestRpcClient modality:FINAL visibility:public superTypes:[kotlinx.rpc.RpcClient]' type=kotlinx.rpc.codegen.test.TestRpcClient
437437
VAR name:failures type:kotlin.collections.MutableList<kotlin.String> [val]
438438
CALL 'public final fun mutableListOf <T> (): kotlin.collections.MutableList<T of kotlin.collections.mutableListOf> declared in kotlin.collections' type=kotlin.collections.MutableList<kotlin.String> origin=null
439439
<T>: kotlin.String
@@ -459,13 +459,13 @@ FILE fqName:<root> fileName:/fields.kt
459459
BLOCK type=kotlin.Boolean origin=null
460460
CALL 'public abstract fun add (element: E of kotlin.collections.MutableList): kotlin.Boolean declared in kotlin.collections.MutableList' type=kotlin.Boolean origin=null
461461
$this: GET_VAR 'val failures: kotlin.collections.MutableList<kotlin.String> declared in <root>.box.<anonymous>.<anonymous>' type=kotlin.collections.MutableList<kotlin.String> origin=null
462-
element: CALL 'public final fun plus (other: kotlin.Any?): kotlin.String declared in kotlin.String' type=kotlin.String origin=PLUS
463-
$this: STRING_CONCATENATION type=kotlin.String
462+
element: STRING_CONCATENATION type=kotlin.String
463+
STRING_CONCATENATION type=kotlin.String
464464
CONST String type=kotlin.String value="plainFlow.size = "
465465
CALL 'public abstract fun <get-size> (): kotlin.Int declared in kotlin.collections.List' type=kotlin.Int origin=GET_PROPERTY
466466
$this: GET_VAR 'val plainFlow: kotlin.collections.List<kotlin.String> declared in <root>.box.<anonymous>.<anonymous>' type=kotlin.collections.List<kotlin.String> origin=null
467467
CONST String type=kotlin.String value=" (expected 1), "
468-
other: STRING_CONCATENATION type=kotlin.String
468+
STRING_CONCATENATION type=kotlin.String
469469
CONST String type=kotlin.String value="plainFlow[0] = \""
470470
CALL 'public final fun getOrNull <T> (index: kotlin.Int): T of kotlin.collections.getOrNull? declared in kotlin.collections' type=kotlin.String? origin=null
471471
<T>: kotlin.String
@@ -494,13 +494,13 @@ FILE fqName:<root> fileName:/fields.kt
494494
BLOCK type=kotlin.Boolean origin=null
495495
CALL 'public abstract fun add (element: E of kotlin.collections.MutableList): kotlin.Boolean declared in kotlin.collections.MutableList' type=kotlin.Boolean origin=null
496496
$this: GET_VAR 'val failures: kotlin.collections.MutableList<kotlin.String> declared in <root>.box.<anonymous>.<anonymous>' type=kotlin.collections.MutableList<kotlin.String> origin=null
497-
element: CALL 'public final fun plus (other: kotlin.Any?): kotlin.String declared in kotlin.String' type=kotlin.String origin=PLUS
498-
$this: STRING_CONCATENATION type=kotlin.String
497+
element: STRING_CONCATENATION type=kotlin.String
498+
STRING_CONCATENATION type=kotlin.String
499499
CONST String type=kotlin.String value="sharedFlow.size = "
500500
CALL 'public abstract fun <get-size> (): kotlin.Int declared in kotlin.collections.List' type=kotlin.Int origin=GET_PROPERTY
501501
$this: GET_VAR 'val sharedFlow: kotlin.collections.List<kotlin.String> declared in <root>.box.<anonymous>.<anonymous>' type=kotlin.collections.List<kotlin.String> origin=null
502502
CONST String type=kotlin.String value=" (expected 1), "
503-
other: STRING_CONCATENATION type=kotlin.String
503+
STRING_CONCATENATION type=kotlin.String
504504
CONST String type=kotlin.String value="sharedFlow[0] = \""
505505
CALL 'public final fun getOrNull <T> (index: kotlin.Int): T of kotlin.collections.getOrNull? declared in kotlin.collections' type=kotlin.String? origin=null
506506
<T>: kotlin.String

tests/compiler-plugin-tests/src/testData/box/fields.fir.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,13 +25,13 @@ FILE: fields.kt
2525
lval failures: R|kotlin/collections/MutableList<kotlin/String>| = R|kotlin/collections/mutableListOf|<R|kotlin/String|>()
2626
when () {
2727
!=(R|<local>/plainFlow|.R|SubstitutionOverride<kotlin/collections/List.size: R|kotlin/Int|>|, Int(1)) || !=(R|<local>/plainFlow|.R|SubstitutionOverride<kotlin/collections/List.get: R|kotlin/String|>|(Int(0)), String(registerPlainFlowField_42)) -> {
28-
R|<local>/failures|.R|SubstitutionOverride<kotlin/collections/MutableList.add: R|kotlin/Boolean|>|(<strcat>(String(plainFlow.size = ), R|<local>/plainFlow|.R|SubstitutionOverride<kotlin/collections/List.size: R|kotlin/Int|>|, String( (expected 1), )).R|kotlin/String.plus|(<strcat>(String(plainFlow[0] = ), String("), R|<local>/plainFlow|.R|kotlin/collections/getOrNull|<R|kotlin/String|>(Int(0)), String("), String( (expected ), String("), String(registerPlainFlowField_42), String("), String()))))
28+
R|<local>/failures|.R|SubstitutionOverride<kotlin/collections/MutableList.add: R|kotlin/Boolean|>|(<strcat>(<strcat>(String(plainFlow.size = ), R|<local>/plainFlow|.R|SubstitutionOverride<kotlin/collections/List.size: R|kotlin/Int|>|, String( (expected 1), )), <strcat>(String(plainFlow[0] = ), String("), R|<local>/plainFlow|.R|kotlin/collections/getOrNull|<R|kotlin/String|>(Int(0)), String("), String( (expected ), String("), String(registerPlainFlowField_42), String("), String()))))
2929
}
3030
}
3131

3232
when () {
3333
!=(R|<local>/sharedFlow|.R|SubstitutionOverride<kotlin/collections/List.size: R|kotlin/Int|>|, Int(1)) || !=(R|<local>/sharedFlow|.R|SubstitutionOverride<kotlin/collections/List.get: R|kotlin/String|>|(Int(0)), String(registerSharedFlowField_42)) -> {
34-
R|<local>/failures|.R|SubstitutionOverride<kotlin/collections/MutableList.add: R|kotlin/Boolean|>|(<strcat>(String(sharedFlow.size = ), R|<local>/sharedFlow|.R|SubstitutionOverride<kotlin/collections/List.size: R|kotlin/Int|>|, String( (expected 1), )).R|kotlin/String.plus|(<strcat>(String(sharedFlow[0] = ), String("), R|<local>/sharedFlow|.R|kotlin/collections/getOrNull|<R|kotlin/String|>(Int(0)), String("), String( (expected ), String("), String(registerSharedFlowField_42), String("), String()))))
34+
R|<local>/failures|.R|SubstitutionOverride<kotlin/collections/MutableList.add: R|kotlin/Boolean|>|(<strcat>(<strcat>(String(sharedFlow.size = ), R|<local>/sharedFlow|.R|SubstitutionOverride<kotlin/collections/List.size: R|kotlin/Int|>|, String( (expected 1), )), <strcat>(String(sharedFlow[0] = ), String("), R|<local>/sharedFlow|.R|kotlin/collections/getOrNull|<R|kotlin/String|>(Int(0)), String("), String( (expected ), String("), String(registerSharedFlowField_42), String("), String()))))
3535
}
3636
}
3737

0 commit comments

Comments
 (0)