Fix tests: "infix modifier required" and "operator modifier required" errors

This commit is contained in:
Yan Zhulanow
2015-11-26 15:56:56 +03:00
parent a3ff3ffc45
commit 9d1af5a17e
635 changed files with 1283 additions and 1617 deletions
+1 -1
View File
@@ -18,7 +18,7 @@ class MathTest {
assertEquals(BigInteger("0"), a / b)
assertEquals(BigInteger("-2"), -a)
assertEquals(BigInteger("1"), -a % b)
assertEquals(BigInteger("-2"), -a remainder b)
assertEquals(BigInteger("-2"), (-a).remainder(b))
}
@test fun testBigDecimal() {
@@ -26,7 +26,7 @@ class MapJVMTest {
@test fun toSortedMapWithComparator() {
val map = mapOf(Pair("c", 3), Pair("bc", 2), Pair("bd", 4), Pair("abc", 1))
val sorted = map.toSortedMap(compareBy<String> { it.length } thenBy { it })
val sorted = map.toSortedMap(compareBy<String> { it.length }.thenBy { it })
assertEquals(listOf("c", "bc", "bd", "abc"), sorted.keys.toList())
assertEquals(1, sorted["abc"])
assertEquals(2, sorted["bc"])
@@ -13,7 +13,7 @@ class ThreadTest {
val pool = Executors.newFixedThreadPool(1)
val countDown = CountDownLatch(1)
pool execute {
pool.execute {
countDown.countDown()
}
assertTrue(countDown.await(2, SECONDS), "Count down is executed")
+10 -10
View File
@@ -9,12 +9,12 @@ class CoercionTest {
fun usage() {
val n = 1
// infix usage
val n1 = n coerceAtLeast 2
val n1 = n.coerceAtLeast(2)
// function usage
val n2 = n.coerceAtLeast(2)
// infix with range
val n3 = n coerceIn 2..5
val n3 = n.coerceIn(2..5)
}
@Test
@@ -32,8 +32,8 @@ class CoercionTest {
expect(value.coerceAtLeast(min)) { value.coerceIn(min, null) }
expect(value.coerceAtMost(max)) { value.coerceIn(null, max) }
expect(value.coerceAtLeast(min).coerceAtMost(max)) { value.coerceIn(min, max) }
expect(value.coerceAtMost(max).coerceAtLeast(min)) { value coerceIn range }
assertTrue((value coerceIn range) in range)
expect(value.coerceAtMost(max).coerceAtLeast(min)) { value.coerceIn(range) }
assertTrue((value.coerceIn(range)) in range)
}
assertFails { 1.coerceIn(1, 0) }
@@ -55,8 +55,8 @@ class CoercionTest {
expect(value.coerceAtLeast(min)) { value.coerceIn(min, null) }
expect(value.coerceAtMost(max)) { value.coerceIn(null, max) }
expect(value.coerceAtLeast(min).coerceAtMost(max)) { value.coerceIn(min, max) }
expect(value.coerceAtMost(max).coerceAtLeast(min)) { value coerceIn range }
assertTrue((value coerceIn range) in range)
expect(value.coerceAtMost(max).coerceAtLeast(min)) { value.coerceIn(range) }
assertTrue((value.coerceIn(range)) in range)
}
assertFails { 1L.coerceIn(1L, 0L) }
@@ -80,8 +80,8 @@ class CoercionTest {
expect(value.coerceAtLeast(min)) { value.coerceIn(min, null) }
expect(value.coerceAtMost(max)) { value.coerceIn(null, max) }
expect(value.coerceAtLeast(min).coerceAtMost(max)) { value.coerceIn(min, max) }
expect(value.coerceAtMost(max).coerceAtLeast(min)) { value coerceIn range }
assertTrue((value coerceIn range) in range)
expect(value.coerceAtMost(max).coerceAtLeast(min)) { value.coerceIn(range) }
assertTrue((value.coerceIn(range)) in range)
}
assertFails { 1.0.coerceIn(1.0, 0.0) }
@@ -109,8 +109,8 @@ class CoercionTest {
expect(value.coerceAtLeast(min)) { value.coerceIn(min, null) }
expect(value.coerceAtMost(max)) { value.coerceIn(null, max) }
expect(value.coerceAtLeast(min).coerceAtMost(max)) { value.coerceIn(min, max) }
expect(value.coerceAtMost(max).coerceAtLeast(min)) { value coerceIn range }
assertTrue((value coerceIn range) in range)
expect(value.coerceAtMost(max).coerceAtLeast(min)) { value.coerceIn(range) }
assertTrue((value.coerceIn(range)) in range)
}
assertFails { v[1].coerceIn(v[1], v[0]) }