Fix deprecations in testData: js semantics.

This commit is contained in:
Ilya Gorbunov
2015-09-15 20:19:57 +03:00
parent 92e66b0d81
commit 0e3e33e5c1
46 changed files with 119 additions and 121 deletions
@@ -23,7 +23,6 @@ fun assertEquals(expected: Any, actual: Any, s: CharSequence, whatTested: String
fun testString(s: String, expectedSize: Int, indexOfB: Int) {
assertEquals(expectedSize, s.size, s, "size")
assertEquals(expectedSize, s.length(), s, "length()")
assertEquals(expectedSize, s.length, s, "length")
assertEquals(expectedSize == 0, s.isEmpty(), s, "isEmpty()")
assertEquals(expectedSize != 0, s.startsWith(startsWithParam), s, "startsWith(\"$startsWithParam\")")
assertEquals(expectedSize != 0, s.endsWith(endsWithParam), s, "endsWith(\"$endsWithParam\")")
@@ -37,7 +36,6 @@ fun testString(s: String, expectedSize: Int, indexOfB: Int) {
fun testCharSequence(s: CharSequence, expectedSize: Int) {
assertEquals(expectedSize, s.size, s, "size")
assertEquals(expectedSize, s.length(), s, "length()")
assertEquals(expectedSize, s.length, s, "length")
assertEquals(expectedSize == 0, s.isEmpty(), s, "isEmpty()")
}
@@ -2,11 +2,11 @@ package foo
fun box(): String {
val testInput = "test data\t1foo 2 bar"
val tests = array(
" " to array("test", "data\t1foo", "", "2", "bar"),
"\\s+" to array("test", "data", "1foo", "2", "bar"),
"[sd]" to array("te", "t ", "ata\t1foo 2 bar"),
"[\\d]" to array("test data\t", "foo ", " bar")
val tests = arrayOf(
" " to arrayOf("test", "data\t1foo", "", "2", "bar"),
"\\s+" to arrayOf("test", "data", "1foo", "2", "bar"),
"[sd]" to arrayOf("te", "t ", "ata\t1foo 2 bar"),
"[\\d]" to arrayOf("test data\t", "foo ", " bar")
)
for (test in tests) {