File tree Expand file tree Collapse file tree 1 file changed +8
-1
lines changed
tests/konsist/src/test/kotlin/io/element/android/tests/konsist Expand file tree Collapse file tree 1 file changed +8
-1
lines changed Original file line number Diff line number Diff 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
You can’t perform that action at this time.
0 commit comments