KT-45777: Reorganize unit test data for classpath snapshot feature

to make it easier to add more tests in the next commits.

- Add unit tests for constants and inline functions

Also add tests for different kinds of Kotlin classes: CLASS,
FILE_FACADE, MULTIFILE_CLASS.

-Add unit test for nested classes

Also remove the existing integration test for nested classes to keep the
integration tests focused on the key scenarios while unit tests will
cover the corner cases.

Ignore inline functions that are private
This commit is contained in:
Hung Nguyen
2021-12-15 19:38:47 +00:00
committed by nataliya.valtman
parent 534cf0c6c8
commit a900f2b66d
153 changed files with 605 additions and 1790 deletions
@@ -0,0 +1,22 @@
package com.example;
public class SomeClass {
public long publicFieldChangedType = 0;
public int publicFieldChangedValue = 1000;
private long privateFieldChangedType = 0;
public long publicMethodChangedSignature() {
return 0;
}
public int publicMethodChangedImplementation() {
return 1000;
}
private long privateMethodChangedSignature() {
return 0;
}
}
@@ -0,0 +1,22 @@
package com.example;
public class SomeClass {
public int publicFieldChangedType = 0;
public int publicFieldChangedValue = 0;
private int privateFieldChangedType = 0;
public int publicMethodChangedSignature() {
return 0;
}
public int publicMethodChangedImplementation() {
return 0;
}
private int privateMethodChangedSignature() {
return 0;
}
}
@@ -0,0 +1,16 @@
package com.example
class SomeClass {
val publicPropertyChangedType: Long = 0
val publicPropertyChangedValue: Int = 1000
private val privatePropertyChangedType: Long = 0
fun publicFunctionChangedSignature(): Long = 0
fun publicFunctionChangedImplementation(): Int = 1000
private fun privateFunctionChangedSignature(): Long = 0
}
@@ -0,0 +1,16 @@
package com.example
class SomeClass {
val publicPropertyChangedType: Int = 0
val publicPropertyChangedValue: Int = 0
private val privatePropertyChangedType: Int = 0
fun publicFunctionChangedSignature(): Int = 0
fun publicFunctionChangedImplementation(): Int = 0
private fun privateFunctionChangedSignature(): Int = 0
}
@@ -0,0 +1,18 @@
package com.example
class SomeClass {
// Constants are not allowed in a class, only allowed at the top level or in an object.
companion object CompanionObject {
const val constantChangedType: Long = 0
const val constantChangedValue: Int = 1000
const val constantUnchanged: Int = 0
private const val privateConstantChangedType: Long = 0
}
inline fun inlineFunctionChangedSignature(): Long = 0
inline fun inlineFunctionChangedImplementation(): Int = 1000
inline fun inlineFunctionChangedUnchanged(): Int = 0
private inline fun privateInlineFunctionChangedSignature(): Long = 0
}
@@ -0,0 +1,18 @@
package com.example
class SomeClass {
// Constants are not allowed in a class, only allowed at the top level or in an object.
companion object CompanionObject {
const val constantChangedType: Int = 0
const val constantChangedValue: Int = 0
const val constantUnchanged: Int = 0
private const val privateConstantChangedType: Int = 0
}
inline fun inlineFunctionChangedSignature(): Int = 0
inline fun inlineFunctionChangedImplementation(): Int = 0
inline fun inlineFunctionChangedUnchanged(): Int = 0
private inline fun privateInlineFunctionChangedSignature(): Int = 0
}
@@ -0,0 +1,7 @@
@file:JvmName("MultifileClass")
@file:JvmMultifileClass
package com.example
val propertyInMultifileClass1 = 0
fun functionInMultifileClass1() = 0
@@ -0,0 +1,7 @@
@file:JvmName("MultifileClass")
@file:JvmMultifileClass
package com.example
val propertyInMultifileClass2 = 0
fun functionInMultifileClass2() = 0
@@ -0,0 +1,16 @@
package com.example
class NormalClass {
val propertyInNormalClass = 0
fun functionInNormalClass() = 0
companion object CompanionObject {
val propertyInCompanionObject = 0
fun functionInCompanionObject() = 0
}
class NestedClass {
val propertyInNestedClass = 0
fun functionInNestedClass() = 0
}
}
@@ -0,0 +1,10 @@
package com.example
class NormalClass {
companion object CompanionObject {
}
class NestedClass {
}
}
@@ -0,0 +1,4 @@
package com.example;
public class SubSubClassOfChangedSuperClass extends SubClassOfChangedSuperClass {
}
@@ -0,0 +1,4 @@
package com.example;
public class SubSubClassOfChangedSuperClass extends SubClassOfChangedSuperClass {
}
@@ -0,0 +1,4 @@
package com.example;
public class JavaSubClassOfChangedJavaSuperClass extends ChangedJavaSuperClass {
}
@@ -0,0 +1,4 @@
package com.example;
public class JavaSubClassOfChangedKotlinSuperClass extends ChangedKotlinSuperClass {
}
@@ -1,4 +0,0 @@
package com.example;
public class JavaSubClassOfKotlinSuperClass extends ChangedKotlinSuperClass {
}
@@ -0,0 +1,4 @@
package com.example;
public class JavaSubClassOfChangedJavaSuperClass extends ChangedJavaSuperClass {
}
@@ -0,0 +1,4 @@
package com.example;
public class JavaSubClassOfChangedKotlinSuperClass extends ChangedKotlinSuperClass {
}
@@ -1,4 +0,0 @@
package com.example;
public class JavaSubClassOfKotlinSuperClass extends ChangedKotlinSuperClass {
}

Some files were not shown because too many files have changed in this diff Show More