String.format does not support no locale #KT-22932
This commit is contained in:
@@ -6,6 +6,7 @@
|
||||
package test.text
|
||||
|
||||
import test.collections.assertArrayNotSameButEquals
|
||||
import test.platformNull
|
||||
import java.util.*
|
||||
import kotlin.test.*
|
||||
|
||||
@@ -41,9 +42,14 @@ class StringJVMTest {
|
||||
assertEquals("1,234,567.890", "%,.3f".format(Locale.ENGLISH, 1234567.890))
|
||||
assertEquals("1.234.567,890", "%,.3f".format(Locale.GERMAN, 1234567.890))
|
||||
assertEquals("1 234 567,890", "%,.3f".format(Locale("fr"), 1234567.890))
|
||||
assertEquals("1,234,567.890", "%,.3f".format(null, 1234567.890))
|
||||
assertEquals("1,234,567.890", "%,.3f".format(platformNull<Locale>(), 1234567.890))
|
||||
|
||||
assertEquals("1,234,567.890", String.format(Locale.ENGLISH, "%,.3f", 1234567.890))
|
||||
assertEquals("1.234.567,890", String.format(Locale.GERMAN, "%,.3f", 1234567.890))
|
||||
assertEquals("1 234 567,890", String.format(Locale("fr"), "%,.3f", 1234567.890))
|
||||
assertEquals("1,234,567.890", String.format(null, "%,.3f", 1234567.890))
|
||||
assertEquals("1,234,567.890", String.format(platformNull<Locale>(), "%,.3f", 1234567.890))
|
||||
}
|
||||
|
||||
@Test fun toByteArrayEncodings() {
|
||||
|
||||
Reference in New Issue
Block a user