Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix deprecated API usage. #1732

Merged
merged 1 commit into from
Dec 6, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading