Simplify the String.toRegex extension to a single function that uses a default arg.
Also moved it to the String.kt source file that that String extension functions can be found in a single place.
This commit is contained in:
@@ -33,4 +33,17 @@ class StringTest() : TestCase() {
|
||||
assertEquals("hey", s.orEmpty())
|
||||
assertEquals("", ns.orEmpty())
|
||||
}
|
||||
|
||||
fun testToShort() {
|
||||
assertEquals(77.toShort(), "77".toShort())
|
||||
}
|
||||
|
||||
fun testToInt() {
|
||||
assertEquals(77, "77".toInt())
|
||||
}
|
||||
|
||||
fun testToLong() {
|
||||
assertEquals(77.toLong(), "77".toLong())
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user