Skip to content

Commit 154114b

Browse files
committed
Konsist: implement another workaround.
1 parent e0a9fbe commit 154114b

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

tests/konsist/src/test/kotlin/io/element/android/tests/konsist/KonsistClassNameTest.kt

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,14 @@ class KonsistClassNameTest {
7474
.replace("FakeRust", "")
7575
.replace("Fake", "")
7676
(it.name.startsWith("Fake") || it.name.startsWith("FakeRust")) &&
77-
it.parents().any { parent -> parent.name.replace(".", "") == interfaceName }
77+
it.parents().any { parent ->
78+
// Workaround to get the parent name. For instance:
79+
// parent.name used to return `UserListPresenter.Factory` but is now returning `Factory`.
80+
// So we need to retrieve the name of the parent class differently.
81+
val packageName = parent.packagee!!.name
82+
val parentName = parent.fullyQualifiedName!!.substringAfter("$packageName.").replace(".", "")
83+
parentName == interfaceName
84+
}
7885
}
7986
}
8087

0 commit comments

Comments
 (0)