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:
Hiram Chirino
2012-03-09 11:57:05 -05:00
parent 0a70ed6aee
commit 3b85642b96
3 changed files with 22 additions and 12 deletions
+13
View File
@@ -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())
}
}