-
-
Notifications
You must be signed in to change notification settings - Fork 389
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
correctly count emojis when composing a post (#4152)
- Loading branch information
Showing
4 changed files
with
46 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,29 +15,29 @@ | |
* see <http://www.gnu.org/licenses>. | ||
*/ | ||
|
||
package com.keylesspalace.tusky.components.compose.ComposeActivity | ||
package com.keylesspalace.tusky.components.compose | ||
|
||
import com.keylesspalace.tusky.SpanUtilsTest | ||
import com.keylesspalace.tusky.components.compose.ComposeActivity | ||
import com.keylesspalace.tusky.util.highlightSpans | ||
import org.junit.Assert.assertEquals | ||
import org.junit.Test | ||
import org.junit.runner.RunWith | ||
import org.junit.runners.Parameterized | ||
import org.robolectric.ParameterizedRobolectricTestRunner | ||
|
||
@RunWith(Parameterized::class) | ||
@RunWith(ParameterizedRobolectricTestRunner::class) | ||
class StatusLengthTest( | ||
private val text: String, | ||
private val expectedLength: Int | ||
) { | ||
companion object { | ||
@Parameterized.Parameters(name = "{0}") | ||
@ParameterizedRobolectricTestRunner.Parameters(name = "{0}") | ||
@JvmStatic | ||
fun data(): Iterable<Any> { | ||
return listOf( | ||
arrayOf("", 0), | ||
arrayOf(" ", 1), | ||
arrayOf("123", 3), | ||
arrayOf("🫣", 1), | ||
// "@user@server" should be treated as "@user" | ||
arrayOf("123 @[email protected]", 12), | ||
// URLs under 23 chars are treated as 23 chars | ||
|