remove method (#6028)

Signed-off-by: parneet-guraya <gurayaparneet@gmail.com>
This commit is contained in:
Parneet Singh 2024-12-14 09:45:52 +05:30 committed by GitHub
parent 2c8c441f25
commit c1acdbe31a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 3 additions and 75 deletions

View file

@ -269,50 +269,10 @@ class UploadMediaDetailAdapterUnitTest {
verify(adapterView, times(3)).adapter
}
@Test
fun testRemoveLeadingAndTrailingWhitespace() {
// empty space
val test1 = " test "
val expected1 = "test"
Assert.assertEquals(expected1, viewHolder.removeLeadingAndTrailingWhitespace(test1))
val test2 = " test test "
val expected2 = "test test"
Assert.assertEquals(expected2, viewHolder.removeLeadingAndTrailingWhitespace(test2))
// No whitespace
val test3 = "No trailing space"
val expected3 = "No trailing space"
Assert.assertEquals(expected3, viewHolder.removeLeadingAndTrailingWhitespace(test3))
// blank string
val test4 = " \r \t "
val expected4 = ""
Assert.assertEquals(expected4, viewHolder.removeLeadingAndTrailingWhitespace(test4))
}
@Test
fun testRemoveLeadingAndTrailingInstanceTab() {
val test = "\ttest\t"
val expected = "test"
Assert.assertEquals(expected, viewHolder.removeLeadingAndTrailingWhitespace(test))
}
@Test
fun testRemoveLeadingAndTrailingCarriageReturn() {
val test = "\rtest\r"
val expected = "test"
Assert.assertEquals(expected, viewHolder.removeLeadingAndTrailingWhitespace(test))
}
@Test
fun testCaptionJapaneseCharacters() {
val test1 = "テスト テスト"
val expected1 = "テスト テスト"
Assert.assertEquals(expected1, viewHolder.convertIdeographicSpaceToLatinSpace(test1))
val test2 = " \r \t テスト \r \t "
val expected2 = "テスト"
Assert.assertEquals(expected2, viewHolder.removeLeadingAndTrailingWhitespace(test2))
}
}