Fix split method usage in JS: split replaced with splitWithRegex or splitBy.
This commit is contained in:
@@ -12,7 +12,7 @@ fun box(): String {
|
||||
for (test in tests) {
|
||||
val regexp = test.first
|
||||
val expected = test.second
|
||||
val result = testInput.split(regexp)
|
||||
val result = testInput.splitWithRegex(regexp)
|
||||
|
||||
if (result != expected) return "Wrong result for '$regexp' -- Expected: $expected | Actual: $result"
|
||||
}
|
||||
@@ -21,7 +21,7 @@ fun box(): String {
|
||||
val regexp = test.first
|
||||
val limit = 2
|
||||
val expected = Array(limit) { test.second[it] }
|
||||
val result = testInput.split(regexp, limit)
|
||||
val result = testInput.splitWithRegex(regexp, limit)
|
||||
|
||||
if (result != expected) return "Wrong result for '$regexp' -- Expected: $expected | Actual: $result"
|
||||
}
|
||||
|
||||
@@ -133,7 +133,7 @@ fun <T, C : MutableCollection<T>> Array<T>.to(result: C): C {
|
||||
}
|
||||
|
||||
fun makeField(s: String): Field {
|
||||
val lines: Array<String> = s.split("\n")
|
||||
val lines: List<String> = s.splitBy("\n")
|
||||
|
||||
val w = max<String>(lines.toList(), comparator<String> { o1, o2 ->
|
||||
val l1: Int = o1.size
|
||||
|
||||
Reference in New Issue
Block a user