mirror of
https://github.com/corda/corda.git
synced 2025-04-07 11:27:01 +00:00
toStringWithSuffix decimal mark unit-test issue on non UK/US Locale (#209)
Make use of default Locale to temporarily bypass unit-testing of toStringWithSuffix failing due to different decimal marks on non anglo saxon Locales.
This commit is contained in:
parent
bc9407d2c8
commit
087570e74d
@ -2,15 +2,20 @@ package net.corda.explorer.views
|
||||
|
||||
import org.junit.Assert.assertEquals
|
||||
import org.junit.Test
|
||||
import java.text.DecimalFormatSymbols
|
||||
import java.util.*
|
||||
|
||||
class GuiUtilitiesKtTest {
|
||||
@Test
|
||||
fun `test to string with suffix`() {
|
||||
assertEquals("10.5k", 10500.toStringWithSuffix())
|
||||
//Required for this test to be independent of the default Locale.
|
||||
val ds = DecimalFormatSymbols(Locale.getDefault()).decimalSeparator
|
||||
|
||||
assertEquals("10${ds}5k", 10500.toStringWithSuffix())
|
||||
assertEquals("100", 100.toStringWithSuffix())
|
||||
assertEquals("5.0M", 5000000.toStringWithSuffix())
|
||||
assertEquals("1.0B", 1000000000.toStringWithSuffix())
|
||||
assertEquals("1.5T", 1500000000000.toStringWithSuffix())
|
||||
assertEquals("1000.0T", 1000000000000000.toStringWithSuffix())
|
||||
assertEquals("5${ds}0M", 5000000.toStringWithSuffix())
|
||||
assertEquals("1${ds}0B", 1000000000.toStringWithSuffix())
|
||||
assertEquals("1${ds}5T", 1500000000000.toStringWithSuffix())
|
||||
assertEquals("1000${ds}0T", 1000000000000000.toStringWithSuffix())
|
||||
}
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user