Skip to content

Commit

Permalink
Fix deprecated API usage. (#1732)
Browse files Browse the repository at this point in the history
  • Loading branch information
colinrtwhite authored Dec 6, 2023
1 parent cda1271 commit ee77a62
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import app.cash.redwood.Modifier
import assertk.assertThat
import assertk.assertions.hashCodeFun
import assertk.assertions.isEqualTo
import assertk.assertions.isSameAs
import assertk.assertions.isSameInstanceAs
import assertk.assertions.toStringFun
import kotlin.test.Test
import kotlin.test.fail
Expand All @@ -35,7 +35,7 @@ class ModifierTest {
val a = NamedModifier("A")
var called = 0
a.forEach { element ->
assertThat(element).isSameAs(a)
assertThat(element).isSameInstanceAs(a)
called++
}
assertThat(called).isEqualTo(1)
Expand All @@ -48,18 +48,18 @@ class ModifierTest {
val expected = listOf(a, b, c)
var called = 0
(a then b then c).forEach { element ->
assertThat(element).isSameAs(expected[called])
assertThat(element).isSameInstanceAs(expected[called])
called++
}
assertThat(called).isEqualTo(3)
}

@Test fun thenIgnoresUnitModifier() {
assertThat(Modifier then Modifier).isSameAs(Modifier)
assertThat(Modifier then Modifier).isSameInstanceAs(Modifier)

val a = NamedModifier("A")
assertThat(a then Modifier).isSameAs(a)
assertThat(Modifier then a).isSameAs(a)
assertThat(a then Modifier).isSameInstanceAs(a)
assertThat(Modifier then a).isSameInstanceAs(a)
}

@Test fun thenElementsToElements() {
Expand All @@ -70,7 +70,7 @@ class ModifierTest {
val expected = listOf(a, b, c, d)
var called = 0
((a then b) then (c then d)).forEach { element ->
assertThat(element).isSameAs(expected[called])
assertThat(element).isSameInstanceAs(expected[called])
called++
}
assertThat(called).isEqualTo(4)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ import app.cash.turbine.test
import assertk.assertThat
import assertk.assertions.hasSize
import assertk.assertions.isEqualTo
import assertk.assertions.isSameAs
import assertk.assertions.isSameInstanceAs
import kotlinx.coroutines.test.runTest
import org.junit.Test
import org.junit.runner.RunWith
Expand All @@ -54,7 +54,7 @@ class TreehouseLayoutTest {
val view = View(activity)
layout.children.insert(0, viewWidget(view))
assertThat(layout.childCount).isEqualTo(1)
assertThat(layout.getChildAt(0)).isSameAs(view)
assertThat(layout.getChildAt(0)).isSameInstanceAs(view)
}

@Test fun attachAndDetachSendsStateChange() {
Expand Down

0 comments on commit ee77a62

Please sign in to comment.