Skip to content

Commit 057b30b

Browse files
KON-621 Issue with type classes with the same names (#1254)
* add tests * fix bug * clean code * merge with KON-628 * remove fqn from parameter declaration * change fullyQualifiedName property to nullable (we need this because of KoPropertyDeclaration and KoFunctionProperty) * change implementation for KoParameterDeclaration * rename package * add tests * change logic in TypeUtil * simplify code * clean code * add test code * upd code * upd code * fix bug * clean code * upd code * clean code * add additional tests * add additional tests * clean code * clean code * fix bug * fix tests * clean code * clean code
1 parent e4ed296 commit 057b30b

File tree

69 files changed

+928
-95
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

69 files changed

+928
-95
lines changed

lib/src/integrationTest/kotlin/com/lemonappdev/konsist/core/declaration/kofunction/KoFunctionDeclarationForKoFullyQualifiedNameProviderTest.kt

+2-2
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ class KoFunctionDeclarationForKoFullyQualifiedNameProviderTest {
3838
.first()
3939

4040
// then
41-
sut.fullyQualifiedName shouldBeEqualTo "com.samplepackage.SampleClass.sampleFunction"
41+
sut.fullyQualifiedName shouldBeEqualTo null
4242
}
4343

4444
@Test
@@ -50,7 +50,7 @@ class KoFunctionDeclarationForKoFullyQualifiedNameProviderTest {
5050
.first()
5151

5252
// then
53-
sut.fullyQualifiedName shouldBeEqualTo "SampleClass.sampleFunction"
53+
sut.fullyQualifiedName shouldBeEqualTo null
5454
}
5555

5656
private fun getSnippetFile(fileName: String) =

lib/src/integrationTest/kotlin/com/lemonappdev/konsist/core/declaration/koparameter/KoParameterDeclarationForKoContainingDeclarationProviderTest.kt

+5-3
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
package com.lemonappdev.konsist.core.declaration.koparameter
22

33
import com.lemonappdev.konsist.TestSnippetProvider.getSnippetKoScope
4-
import org.amshove.kluent.shouldNotBeEqualTo
4+
import com.lemonappdev.konsist.api.declaration.KoClassDeclaration
5+
import com.lemonappdev.konsist.api.declaration.KoFunctionDeclaration
6+
import org.amshove.kluent.shouldBeInstanceOf
57
import org.junit.jupiter.api.Test
68

79
class KoParameterDeclarationForKoContainingDeclarationProviderTest {
@@ -17,7 +19,7 @@ class KoParameterDeclarationForKoContainingDeclarationProviderTest {
1719
?.first()
1820

1921
// then
20-
sut?.containingDeclaration shouldNotBeEqualTo null
22+
sut?.containingDeclaration?.shouldBeInstanceOf(KoClassDeclaration::class)
2123
}
2224

2325
@Test
@@ -31,7 +33,7 @@ class KoParameterDeclarationForKoContainingDeclarationProviderTest {
3133
.first()
3234

3335
// then
34-
sut.containingDeclaration shouldNotBeEqualTo null
36+
sut.containingDeclaration.shouldBeInstanceOf(KoFunctionDeclaration::class)
3537
}
3638

3739
private fun getSnippetFile(fileName: String) =

lib/src/integrationTest/kotlin/com/lemonappdev/konsist/core/declaration/koproperty/KoPropertyDeclarationForKoFullyQualifiedNameProviderTest.kt

+2-2
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ class KoPropertyDeclarationForKoFullyQualifiedNameProviderTest {
3838
.first()
3939

4040
// then
41-
sut.fullyQualifiedName shouldBeEqualTo "com.samplepackage.SampleClass.sampleProperty"
41+
sut.fullyQualifiedName shouldBeEqualTo null
4242
}
4343

4444
@Test
@@ -50,7 +50,7 @@ class KoPropertyDeclarationForKoFullyQualifiedNameProviderTest {
5050
.first()
5151

5252
// then
53-
sut.fullyQualifiedName shouldBeEqualTo "SampleClass.sampleProperty"
53+
sut.fullyQualifiedName shouldBeEqualTo null
5454
}
5555

5656
private fun getSnippetFile(fileName: String) =

0 commit comments

Comments
 (0)