Get rid of deprecated annotations and modifiers in stdlib (besides JS)

This commit is contained in:
Denis Zharkov
2015-09-14 16:35:30 +03:00
parent 9c4564a5a6
commit 5cecaa6f87
133 changed files with 1203 additions and 1085 deletions
@@ -17,7 +17,8 @@ class CoercionTest {
val n3 = n coerceIn 2..5
}
Test fun coercionsInt() {
@Test
fun coercionsInt() {
expect(5) { 5.coerceAtLeast(1) }
expect(5) { 1.coerceAtLeast(5) }
expect(1) { 5.coerceAtMost(1) }
@@ -39,7 +40,8 @@ class CoercionTest {
fails { 1.coerceIn(1..0) }
}
Test fun coercionsLong() {
@Test
fun coercionsLong() {
expect(5L) { 5L.coerceAtLeast(1L) }
expect(5L) { 1L.coerceAtLeast(5L) }
expect(1L) { 5L.coerceAtMost(1L) }
@@ -62,7 +64,8 @@ class CoercionTest {
}
Test fun coercionsDouble() {
@Test
fun coercionsDouble() {
expect(5.0) { 5.0.coerceAtLeast(1.0) }
expect(5.0) { 1.0.coerceAtLeast(5.0) }
expect(1.0) { 5.0.coerceAtMost(1.0) }
@@ -84,7 +87,8 @@ class CoercionTest {
fails { 1.0.coerceIn(1.0..0.0) }
}
Test fun coercionsComparable() {
@Test
fun coercionsComparable() {
val v = 0..10 map { ComparableNumber(it) }
expect(5) { v[5].coerceAtLeast(v[1]).value }
+8 -8
View File
@@ -6,7 +6,7 @@ import kotlin.test.*
class NumbersTest {
test fun intMinMaxValues() {
@test fun intMinMaxValues() {
assertTrue(Int.MIN_VALUE < 0)
assertTrue(Int.MAX_VALUE > 0)
@@ -16,7 +16,7 @@ class NumbersTest {
// expect(Int.MAX_VALUE) { Int.MIN_VALUE - 1 }
}
test fun longMinMaxValues() {
@test fun longMinMaxValues() {
assertTrue(Long.MIN_VALUE < 0)
assertTrue(Long.MAX_VALUE > 0)
// overflow behavior
@@ -24,7 +24,7 @@ class NumbersTest {
expect(Long.MAX_VALUE) { Long.MIN_VALUE - 1 }
}
test fun shortMinMaxValues() {
@test fun shortMinMaxValues() {
assertTrue(Short.MIN_VALUE < 0)
assertTrue(Short.MAX_VALUE > 0)
// overflow behavior
@@ -32,7 +32,7 @@ class NumbersTest {
expect(Short.MAX_VALUE) { (Short.MIN_VALUE - 1).toShort() }
}
test fun byteMinMaxValues() {
@test fun byteMinMaxValues() {
assertTrue(Byte.MIN_VALUE < 0)
assertTrue(Byte.MAX_VALUE > 0)
// overflow behavior
@@ -40,7 +40,7 @@ class NumbersTest {
expect(Byte.MAX_VALUE) { (Byte.MIN_VALUE - 1).toByte() }
}
test fun doubleMinMaxValues() {
@test fun doubleMinMaxValues() {
assertTrue(Double.MIN_VALUE > 0)
assertTrue(Double.MAX_VALUE > 0)
// overflow behavior
@@ -49,7 +49,7 @@ class NumbersTest {
expect(0.0) { Double.MIN_VALUE / 2 }
}
test fun floatMinMaxValues() {
@test fun floatMinMaxValues() {
assertTrue(Float.MIN_VALUE > 0)
assertTrue(Float.MAX_VALUE > 0)
// overflow behavior
@@ -58,7 +58,7 @@ class NumbersTest {
expect(0.0F) { Float.MIN_VALUE / 2.0F }
}
test fun doubleProperties() {
@test fun doubleProperties() {
for (value in listOf(1.0, 0.0, Double.MIN_VALUE, Double.MAX_VALUE))
doTestNumber(value)
for (value in listOf(Double.POSITIVE_INFINITY, Double.NEGATIVE_INFINITY))
@@ -66,7 +66,7 @@ class NumbersTest {
doTestNumber(Double.NaN, isNaN = true)
}
test fun floatProperties() {
@test fun floatProperties() {
for (value in listOf(1.0F, 0.0F, Float.MAX_VALUE, Float.MIN_VALUE))
doTestNumber(value)
for (value in listOf(Float.POSITIVE_INFINITY, Float.NEGATIVE_INFINITY))