[Test] KT-61360: add tests for the IrFakeOverrideBuilder
Add tests for fake overrides with focus on java interoperability Co-authored-by: Aleksandra Arsenteva <aleksandra.arsenteva@jetbrains.com>
This commit is contained in:
committed by
Space Team
parent
30aae741a6
commit
82255d5ee8
Vendored
+79
@@ -0,0 +1,79 @@
|
||||
abstract class A : SortedSet<Int>, Set<Int> {
|
||||
constructor() /* primary */ {
|
||||
super/*Any*/()
|
||||
/* <init>() */
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
abstract class B : SortedSet<Int>, Set<Int> {
|
||||
override val size: Int
|
||||
field = size
|
||||
override get
|
||||
|
||||
constructor(size: Int) /* primary */ {
|
||||
super/*Any*/()
|
||||
/* <init>() */
|
||||
|
||||
}
|
||||
|
||||
override fun first(): Int {
|
||||
return 1
|
||||
}
|
||||
|
||||
override fun reversed(): SortedSet<Int> {
|
||||
return CHECK_NOT_NULL<Nothing>(arg0 = null)
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
abstract class C : SortedSet<Int?>, MutableSet<Int?> {
|
||||
constructor() /* primary */ {
|
||||
super/*Any*/()
|
||||
/* <init>() */
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
abstract class D : SortedSet<Int?>, MutableSet<Int?> {
|
||||
constructor() /* primary */ {
|
||||
super/*Any*/()
|
||||
/* <init>() */
|
||||
|
||||
}
|
||||
|
||||
override fun addLast(e: Int?) {
|
||||
}
|
||||
|
||||
override fun reversed(): SortedSet<Int?>? {
|
||||
return CHECK_NOT_NULL<Nothing>(arg0 = null)
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
fun test(a: A, b: B, c: C, d: D) {
|
||||
a.<get-size>() /*~> Unit */
|
||||
a.add(element = 1) /*~> Unit */
|
||||
a.remove(element = 1) /*~> Unit */
|
||||
a.addFirst(p0 = 1)
|
||||
a.addLast(p0 = null)
|
||||
a.removeFirst() /*~> Unit */
|
||||
a.removeLast() /*~> Unit */
|
||||
a.reversed() /*~> Unit */
|
||||
a.getFirst() /*~> Unit */
|
||||
b.reversed() /*~> Unit */
|
||||
b.getFirst() /*~> Unit */
|
||||
c.<get-size>() /*~> Unit */
|
||||
c.add(element = 1) /*~> Unit */
|
||||
c.remove(element = 1) /*~> Unit */
|
||||
c.addFirst(p0 = 1)
|
||||
c.addLast(p0 = null)
|
||||
c.removeFirst() /*~> Unit */
|
||||
c.removeLast() /*~> Unit */
|
||||
c.reversed() /*~> Unit */
|
||||
c.getFirst() /*~> Unit */
|
||||
d.reversed() /*~> Unit */
|
||||
d.addLast(e = null)
|
||||
}
|
||||
Reference in New Issue
Block a user