Skip to content

Commit ee19c86

Browse files
committed
Reverts make TextController support equals
1 parent be834d1 commit ee19c86

File tree

2 files changed

+0
-27
lines changed

2 files changed

+0
-27
lines changed

workflow-ui/core-common/src/main/java/com/squareup/workflow1/ui/TextController.kt

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -87,17 +87,4 @@ private class TextControllerImpl(initialValue: String) : TextController {
8787
set(value) {
8888
_textValue.value = value
8989
}
90-
91-
override fun equals(other: Any?): Boolean {
92-
if (this === other) return true
93-
if (javaClass != other?.javaClass) return false
94-
95-
other as TextController
96-
97-
return textValue == other.textValue
98-
}
99-
100-
override fun hashCode(): Int {
101-
return textValue.hashCode()
102-
}
10390
}

workflow-ui/core-common/src/test/java/com/squareup/workflow1/ui/TextControllerTest.kt

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@ import app.cash.turbine.test
44
import com.google.common.truth.Truth.assertThat
55
import kotlinx.coroutines.test.runTest
66
import org.junit.Test
7-
import kotlin.test.assertEquals
8-
import kotlin.test.assertNotEquals
97

108
@OptIn(WorkflowUiExperimentalApi::class)
119
internal class TextControllerTest {
@@ -36,16 +34,4 @@ internal class TextControllerTest {
3634
expectNoEvents()
3735
}
3836
}
39-
40-
@Test fun `equals works with the same value`() {
41-
val controller1 = TextController(initialValue = "apple")
42-
val controller2 = TextController(initialValue = "apple")
43-
assertEquals(controller1, controller2)
44-
}
45-
46-
@Test fun `equals works with different values`() {
47-
val controller1 = TextController(initialValue = "apple")
48-
val controller2 = TextController(initialValue = "orange")
49-
assertNotEquals(controller1, controller2)
50-
}
5137
}

0 commit comments

Comments
 (0)