mirror of
https://github.com/jlengrand/kotlin.git
synced 2026-05-08 08:31:26 +00:00
Extensions on nullable types remain in Library.kt #KT-1741 Obsolete #KT-2805 Obsolete #KT-1365 Fixed #KT-4517 In Progress
35 lines
887 B
Kotlin
Vendored
35 lines
887 B
Kotlin
Vendored
class T4(
|
|
val c1: Boolean,
|
|
val c2: Boolean,
|
|
val c3: Boolean,
|
|
val c4: String
|
|
) {
|
|
override fun equals(o: Any?): Boolean {
|
|
if (o !is T4) return false;
|
|
return c1 == o.c1 &&
|
|
c2 == o.c2 &&
|
|
c3 == o.c3 &&
|
|
c4 == o.c4
|
|
}
|
|
}
|
|
|
|
fun reformat(
|
|
str : String,
|
|
normalizeCase : Boolean = true,
|
|
uppercaseFirstLetter : Boolean = true,
|
|
divideByCamelHumps : Boolean = true,
|
|
wordSeparator : String = " "
|
|
) =
|
|
T4(normalizeCase, uppercaseFirstLetter, divideByCamelHumps, wordSeparator)
|
|
|
|
|
|
fun box() : String {
|
|
val expected = T4(true, true, true, " ")
|
|
if(reformat("", true, true, true, " ") != expected) return "fail"
|
|
if(reformat("", true, true, true) != expected) return "fail"
|
|
if(reformat("", true, true) != expected) return "fail"
|
|
if(reformat("", true) != expected) return "fail"
|
|
if(reformat("") != expected) return "fail"
|
|
return "OK"
|
|
}
|