Skip to content
This repository was archived by the owner on Jan 20, 2023. It is now read-only.

Commit 6de076c

Browse files
committed
テストケースを追加
1 parent b8354c0 commit 6de076c

File tree

1 file changed

+19
-3
lines changed

1 file changed

+19
-3
lines changed

src/test/kotlin/com/mapk/fastkfunction/fastkfunction/FullInitializedCallTest.kt

Lines changed: 19 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,12 @@ private fun FullInitializedCallTest.Class.topLevelExtensionFunc(arg1: Int, arg2:
2727
* - インスタンスメソッド + インスタンス
2828
* - コンパニオンオブジェクトに定義したメソッド
2929
* - コンパニオンオブジェクトに定義したメソッド + コンパニオンオブジェクトインスタンス
30+
* - リフレクションで取得したコンパニオンオブジェクトに定義したメソッド
31+
* - リフレクションで取得したコンパニオンオブジェクトに定義したメソッド + コンパニオンオブジェクトインスタンス
3032
* - トップレベル関数
31-
* - トップレベル拡張関数 + レシーバインスタンス
33+
* - クラスから取得したトップレベル拡張関数 + レシーバインスタンス
34+
* - インスタンスから取得したトップレベル拡張関数
35+
* - インスタンスから取得したトップレベル拡張関数 + インスタンス
3236
*/
3337
@TestInstance(TestInstance.Lifecycle.PER_CLASS)
3438
private class FullInitializedCallTest {
@@ -84,9 +88,21 @@ private class FullInitializedCallTest {
8488
Arguments.of(::instanceFunction, null, "instance func"),
8589
Arguments.of(::instanceFunction, this, "instance func with instance"),
8690
Arguments.of((Dst)::of, null, "companion object func"),
87-
Arguments.of(companionRawFunc, Dst::class.companionObjectInstance, "companion object func with instance"),
91+
Arguments.of((Dst)::of, Dst::class.companionObjectInstance, "companion object func with instance"),
92+
Arguments.of(companionRawFunc, null, "companion object func from reflection"),
93+
Arguments.of(
94+
companionRawFunc,
95+
Dst::class.companionObjectInstance,
96+
"companion object func from reflection with instance"
97+
),
8898
Arguments.of(::topLevelFunc, null, "top level func"),
89-
Arguments.of(Class::topLevelExtensionFunc, Class(), "top level extension func")
99+
Arguments.of(Class::topLevelExtensionFunc, Class(), "top level extension func from class"),
100+
Class().let {
101+
Arguments.of(it::topLevelExtensionFunc, null, "top level extension func from instance")
102+
},
103+
Class().let {
104+
Arguments.of(it::topLevelExtensionFunc, it, "top level extension func from instance with instance")
105+
}
90106
).stream()
91107
}
92108
}

0 commit comments

Comments
 (0)