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:
committed by
nataliya.valtman
parent
534cf0c6c8
commit
a900f2b66d
BIN
Binary file not shown.
BIN
Binary file not shown.
+22
@@ -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;
|
||||
}
|
||||
}
|
||||
+22
@@ -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;
|
||||
}
|
||||
}
|
||||
+16
@@ -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
|
||||
}
|
||||
+16
@@ -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
|
||||
}
|
||||
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
+18
@@ -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
|
||||
}
|
||||
+18
@@ -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
|
||||
}
|
||||
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
+4
@@ -0,0 +1,4 @@
|
||||
package com.example
|
||||
|
||||
val propertyInFileFacade = 0
|
||||
fun functionInFileFacade() = 0
|
||||
+7
@@ -0,0 +1,7 @@
|
||||
@file:JvmName("MultifileClass")
|
||||
@file:JvmMultifileClass
|
||||
|
||||
package com.example
|
||||
|
||||
val propertyInMultifileClass1 = 0
|
||||
fun functionInMultifileClass1() = 0
|
||||
+7
@@ -0,0 +1,7 @@
|
||||
@file:JvmName("MultifileClass")
|
||||
@file:JvmMultifileClass
|
||||
|
||||
package com.example
|
||||
|
||||
val propertyInMultifileClass2 = 0
|
||||
fun functionInMultifileClass2() = 0
|
||||
+16
@@ -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
|
||||
}
|
||||
}
|
||||
+1
@@ -0,0 +1 @@
|
||||
package com.example
|
||||
+4
@@ -0,0 +1,4 @@
|
||||
@file:JvmName("MultifileClass")
|
||||
@file:JvmMultifileClass
|
||||
|
||||
package com.example
|
||||
+4
@@ -0,0 +1,4 @@
|
||||
@file:JvmName("MultifileClass")
|
||||
@file:JvmMultifileClass
|
||||
|
||||
package com.example
|
||||
+10
@@ -0,0 +1,10 @@
|
||||
package com.example
|
||||
|
||||
class NormalClass {
|
||||
|
||||
companion object CompanionObject {
|
||||
}
|
||||
|
||||
class NestedClass {
|
||||
}
|
||||
}
|
||||
+4
@@ -0,0 +1,4 @@
|
||||
package com.example;
|
||||
|
||||
public class SubClassOfChangedSuperClass extends ChangedSuperClass {
|
||||
}
|
||||
+4
@@ -0,0 +1,4 @@
|
||||
package com.example;
|
||||
|
||||
public class SubSubClassOfChangedSuperClass extends SubClassOfChangedSuperClass {
|
||||
}
|
||||
+2
-1
@@ -4,6 +4,7 @@ public class ChangedSuperClass {
|
||||
|
||||
public int changedField = 0;
|
||||
|
||||
public void changedMethod() {
|
||||
public int changedMethod() {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
+4
@@ -0,0 +1,4 @@
|
||||
package com.example;
|
||||
|
||||
public class SubClassOfChangedSuperClass extends ChangedSuperClass {
|
||||
}
|
||||
+4
@@ -0,0 +1,4 @@
|
||||
package com.example;
|
||||
|
||||
public class SubSubClassOfChangedSuperClass extends SubClassOfChangedSuperClass {
|
||||
}
|
||||
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
+4
@@ -0,0 +1,4 @@
|
||||
package com.example;
|
||||
|
||||
public class JavaSubClassOfChangedJavaSuperClass extends ChangedJavaSuperClass {
|
||||
}
|
||||
+4
@@ -0,0 +1,4 @@
|
||||
package com.example;
|
||||
|
||||
public class JavaSubClassOfChangedKotlinSuperClass extends ChangedKotlinSuperClass {
|
||||
}
|
||||
-4
@@ -1,4 +0,0 @@
|
||||
package com.example;
|
||||
|
||||
public class JavaSubClassOfJavaSuperClass extends ChangedJavaSuperClass {
|
||||
}
|
||||
-4
@@ -1,4 +0,0 @@
|
||||
package com.example;
|
||||
|
||||
public class JavaSubClassOfKotlinSuperClass extends ChangedKotlinSuperClass {
|
||||
}
|
||||
+3
@@ -0,0 +1,3 @@
|
||||
package com.example
|
||||
|
||||
class KotlinSubClassOfChangedJavaSuperClass : ChangedJavaSuperClass()
|
||||
+3
@@ -0,0 +1,3 @@
|
||||
package com.example
|
||||
|
||||
class KotlinSubClassOfChangedKotlinSuperClass : ChangedKotlinSuperClass()
|
||||
-3
@@ -1,3 +0,0 @@
|
||||
package com.example
|
||||
|
||||
class KotlinSubClassOfJavaSuperClass : ChangedJavaSuperClass()
|
||||
-3
@@ -1,3 +0,0 @@
|
||||
package com.example
|
||||
|
||||
class KotlinSubClassOfKotlinSuperClass : ChangedKotlinSuperClass()
|
||||
+4
@@ -0,0 +1,4 @@
|
||||
package com.example;
|
||||
|
||||
public class JavaSubClassOfChangedJavaSuperClass extends ChangedJavaSuperClass {
|
||||
}
|
||||
+4
@@ -0,0 +1,4 @@
|
||||
package com.example;
|
||||
|
||||
public class JavaSubClassOfChangedKotlinSuperClass extends ChangedKotlinSuperClass {
|
||||
}
|
||||
-4
@@ -1,4 +0,0 @@
|
||||
package com.example;
|
||||
|
||||
public class JavaSubClassOfJavaSuperClass extends ChangedJavaSuperClass {
|
||||
}
|
||||
-4
@@ -1,4 +0,0 @@
|
||||
package com.example;
|
||||
|
||||
public class JavaSubClassOfKotlinSuperClass extends ChangedKotlinSuperClass {
|
||||
}
|
||||
+3
@@ -0,0 +1,3 @@
|
||||
package com.example
|
||||
|
||||
class KotlinSubClassOfChangedJavaSuperClass : ChangedJavaSuperClass()
|
||||
+3
@@ -0,0 +1,3 @@
|
||||
package com.example
|
||||
|
||||
class KotlinSubClassOfChangedKotlinSuperClass : ChangedKotlinSuperClass()
|
||||
-3
@@ -1,3 +0,0 @@
|
||||
package com.example
|
||||
|
||||
class KotlinSubClassOfJavaSuperClass : ChangedJavaSuperClass()
|
||||
-3
@@ -1,3 +0,0 @@
|
||||
package com.example
|
||||
|
||||
class KotlinSubClassOfKotlinSuperClass : ChangedKotlinSuperClass()
|
||||
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
+3
@@ -0,0 +1,3 @@
|
||||
package com.example
|
||||
|
||||
open class SubClassOfChangedSuperClass : ChangedSuperClass()
|
||||
+3
@@ -0,0 +1,3 @@
|
||||
package com.example
|
||||
|
||||
class SubSubClassOfChangedSuperClass : SubClassOfChangedSuperClass()
|
||||
+1
-1
@@ -2,5 +2,5 @@ package com.example;
|
||||
|
||||
open class ChangedSuperClass {
|
||||
val changedProperty = 0
|
||||
fun changedFunction() {}
|
||||
fun changedFunction() = 0
|
||||
}
|
||||
+3
@@ -0,0 +1,3 @@
|
||||
package com.example
|
||||
|
||||
open class SubClassOfChangedSuperClass : ChangedSuperClass()
|
||||
+3
@@ -0,0 +1,3 @@
|
||||
package com.example
|
||||
|
||||
class SubSubClassOfChangedSuperClass : SubClassOfChangedSuperClass()
|
||||
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
-4
@@ -1,4 +0,0 @@
|
||||
package com.example;
|
||||
|
||||
public class SubClass extends ChangedSuperClass {
|
||||
}
|
||||
-4
@@ -1,4 +0,0 @@
|
||||
package com.example;
|
||||
|
||||
public class SubSubClass extends SubClass {
|
||||
}
|
||||
-4
@@ -1,4 +0,0 @@
|
||||
package com.example;
|
||||
|
||||
public class SubClass extends ChangedSuperClass {
|
||||
}
|
||||
-4
@@ -1,4 +0,0 @@
|
||||
package com.example;
|
||||
|
||||
public class SubSubClass extends SubClass {
|
||||
}
|
||||
-3
@@ -1,3 +0,0 @@
|
||||
package com.example
|
||||
|
||||
open class SubClass : ChangedSuperClass()
|
||||
-3
@@ -1,3 +0,0 @@
|
||||
package com.example
|
||||
|
||||
class SubSubClass : SubClass()
|
||||
-3
@@ -1,3 +0,0 @@
|
||||
package com.example
|
||||
|
||||
open class SubClass : ChangedSuperClass()
|
||||
-3
@@ -1,3 +0,0 @@
|
||||
package com.example
|
||||
|
||||
class SubSubClass : SubClass()
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user