Skip to content

Commit

Permalink
✨ Pass interface is test
Browse files Browse the repository at this point in the history
  • Loading branch information
yhs0602 committed May 15, 2024
1 parent 3cf6d33 commit d34a323
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 0 deletions.
Binary file modified src/test/resources/advanced/classes4.dex
Binary file not shown.
42 changes: 42 additions & 0 deletions src/test/resources/advanced/instanceoftest.kt
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,24 @@ open class D: C()

open class E: D()

interface I1

interface I2

interface I3: I1

open class F1: I1

open class F2: I2

open class F3: I3

class F4: F1()

class F5: F2()

class F6: F3(), I2

fun testInstanceOf() {
val b = B()
val c = C()
Expand Down Expand Up @@ -37,4 +55,28 @@ fun testInstanceOf() {
assert(c is B)

println("All tests passed!")

val f1 = F1()
val f2 = F2()
val f3 = F3()
val f4 = F4()
val f5 = F5()
val f6 = F6()

assert(f1 is I1)
assert(f2 is I2)
assert(f3 is I3)
assert(f3 is I1)
assert(f4 is I1)
assert(f5 is I2)
assert(f6 is I2)

assert(f1 !is I2)
assert(f2 !is I1)
assert(f3 is I1)
assert((f4 as Any) !is I2)
assert((f5 as Any) !is I1)
assert(f6 is I1)

println("All tests passed!")
}

0 comments on commit d34a323

Please sign in to comment.