parent
309f823cc4
commit
a49a104475
1 changed files with 9 additions and 9 deletions
|
@ -1,19 +1,19 @@
|
|||
package info.nightscout.core.utils
|
||||
|
||||
import com.google.common.truth.Truth.assertThat
|
||||
import info.nightscout.core.utils.receivers.StringUtils
|
||||
import org.junit.jupiter.api.Assertions
|
||||
import org.junit.jupiter.api.Test
|
||||
|
||||
class StringUtilsTest {
|
||||
|
||||
@Test fun removeSurroundingQuotesTest() {
|
||||
var compareString = "test"
|
||||
Assertions.assertEquals(compareString, StringUtils.removeSurroundingQuotes(compareString))
|
||||
Assertions.assertEquals(compareString, StringUtils.removeSurroundingQuotes("\"" + compareString + "\""))
|
||||
Assertions.assertEquals("\"" + compareString, StringUtils.removeSurroundingQuotes("\"" + compareString))
|
||||
compareString = "te\"st"
|
||||
Assertions.assertEquals(compareString, StringUtils.removeSurroundingQuotes(compareString))
|
||||
Assertions.assertEquals(compareString, StringUtils.removeSurroundingQuotes("\"" + compareString + "\""))
|
||||
Assertions.assertEquals("\"" + compareString, StringUtils.removeSurroundingQuotes("\"" + compareString))
|
||||
assertThat(StringUtils.removeSurroundingQuotes(compareString)).isEqualTo(compareString)
|
||||
assertThat(StringUtils.removeSurroundingQuotes("\"" + compareString + "\"")).isEqualTo(compareString)
|
||||
assertThat(StringUtils.removeSurroundingQuotes("\"" + compareString)).isEqualTo("\"" + compareString)
|
||||
compareString = """te"st"""
|
||||
assertThat(StringUtils.removeSurroundingQuotes(compareString)).isEqualTo(compareString)
|
||||
assertThat(StringUtils.removeSurroundingQuotes("\"" + compareString + "\"")).isEqualTo(compareString)
|
||||
assertThat(StringUtils.removeSurroundingQuotes("\"" + compareString)).isEqualTo("\"" + compareString)
|
||||
}
|
||||
}
|
Loading…
Reference in a new issue