Move bidi methods to BidiUtil.

This commit is contained in:
Greyson Parrelli
2025-02-27 13:58:22 -05:00
parent 791e95c645
commit e9e62b98f3
15 changed files with 201 additions and 186 deletions

View File

@@ -14,7 +14,7 @@ import org.junit.Test
import org.junit.runner.RunWith
import org.robolectric.RobolectricTestRunner
import org.robolectric.annotation.Config
import org.signal.core.util.StringUtil
import org.signal.core.util.BidiUtil
import org.signal.storageservice.protos.groups.AccessControl
import org.signal.storageservice.protos.groups.AccessControl.AccessRequired
import org.signal.storageservice.protos.groups.AccessControl.AccessRequired.ADMINISTRATOR
@@ -683,7 +683,7 @@ class GroupsV2UpdateMessageProducerTest {
.title("New title")
.build()
assertEquals(listOf("Alice changed the group name to \"" + StringUtil.isolateBidi("New title") + "\"."), describeChange(change))
assertEquals(listOf("Alice changed the group name to \"" + BidiUtil.isolateBidi("New title") + "\"."), describeChange(change))
}
@Test
@@ -692,7 +692,7 @@ class GroupsV2UpdateMessageProducerTest {
.title("Title 2")
.build()
assertEquals(listOf("You changed the group name to \"" + StringUtil.isolateBidi("Title 2") + "\"."), describeChange(change))
assertEquals(listOf("You changed the group name to \"" + BidiUtil.isolateBidi("Title 2") + "\"."), describeChange(change))
}
@Test
@@ -701,7 +701,7 @@ class GroupsV2UpdateMessageProducerTest {
.title("Title 3")
.build()
assertEquals(listOf("The group name has changed to \"" + StringUtil.isolateBidi("Title 3") + "\"."), describeChange(change))
assertEquals(listOf("The group name has changed to \"" + BidiUtil.isolateBidi("Title 3") + "\"."), describeChange(change))
}
// Avatar change
@@ -1166,7 +1166,7 @@ class GroupsV2UpdateMessageProducerTest {
listOf(
"Alice added you to the group.",
"Alice added Bob.",
"Alice changed the group name to \"" + StringUtil.isolateBidi("Title") + "\".",
"Alice changed the group name to \"" + BidiUtil.isolateBidi("Title") + "\".",
"Alice set the disappearing message timer to 5 minutes.",
"Alice changed who can edit group membership to \"All members\"."
),
@@ -1219,7 +1219,7 @@ class GroupsV2UpdateMessageProducerTest {
assertEquals(
listOf(
"Bob joined the group.",
"The group name has changed to \"" + StringUtil.isolateBidi("Title 2") + "\".",
"The group name has changed to \"" + BidiUtil.isolateBidi("Title 2") + "\".",
"The group avatar has been changed.",
"The disappearing message timer has been set to 10 minutes.",
"Who can edit group membership has been changed to \"All members\"."
@@ -1241,7 +1241,7 @@ class GroupsV2UpdateMessageProducerTest {
listOf(
"Alice joined the group.",
"Alice is now an admin.",
"The group name has changed to \"" + StringUtil.isolateBidi("Updated title") + "\".",
"The group name has changed to \"" + BidiUtil.isolateBidi("Updated title") + "\".",
"Alice is no longer in the group."
),
describeChange(change)