File tree 1 file changed +39
-0
lines changed
compiler/suspend-transform-plugin/src/test/kotlin/love/forte/plugin/suspendtrans/test 1 file changed +39
-0
lines changed Original file line number Diff line number Diff line change
1
+ package love.forte.plugin.suspendtrans.test
2
+
3
+ import love.forte.plugin.suspendtrans.CliOptions
4
+ import love.forte.plugin.suspendtrans.SuspendTransformConfiguration
5
+ import kotlin.test.Test
6
+ import kotlin.test.assertEquals
7
+
8
+
9
+ /* *
10
+ *
11
+ * @author ForteScarlet
12
+ */
13
+ class CliOptionsTest {
14
+
15
+ @Test
16
+ fun formatTest () {
17
+ val annotations = listOf (
18
+ SuspendTransformConfiguration .IncludeAnnotation (" Hello" , false ),
19
+ SuspendTransformConfiguration .IncludeAnnotation (" World" , true )
20
+ )
21
+
22
+ val config = SuspendTransformConfiguration ().apply {
23
+ jvm {
24
+ syntheticBlockingFunctionIncludeAnnotations = annotations
25
+ }
26
+ }
27
+
28
+ CliOptions .Jvm .SYNTHETIC_BLOCKING_FUNCTION_INCLUDE_ANNOTATIONS .also { opt ->
29
+ val value = opt.resolveToValue(config)
30
+ val newConfig = SuspendTransformConfiguration ()
31
+ opt.resolveFromValue(newConfig, value)
32
+ assertEquals(annotations, newConfig.jvm.syntheticBlockingFunctionIncludeAnnotations)
33
+ }
34
+
35
+
36
+ }
37
+
38
+
39
+ }
You can’t perform that action at this time.
0 commit comments