Get rid of deprecated annotations and modifiers in stdlib (besides JS)
This commit is contained in:
@@ -35,7 +35,7 @@ class MyChangeListener : ChangeListener {
|
||||
|
||||
class PropertiesTest {
|
||||
|
||||
test fun testModel() {
|
||||
@test fun testModel() {
|
||||
val c = Customer()
|
||||
c.name = "James"
|
||||
c.city = "Mells"
|
||||
|
||||
@@ -5,7 +5,7 @@ import kotlin.test.*
|
||||
import kotlin.properties.*
|
||||
|
||||
class NotNullVarTest() {
|
||||
test fun doTest() {
|
||||
@test fun doTest() {
|
||||
NotNullVarTestGeneric("a", "b").doTest()
|
||||
}
|
||||
}
|
||||
@@ -27,7 +27,7 @@ class ObservablePropertyInChangeSupportTest: ChangeSupport() {
|
||||
var b by property(init = 2)
|
||||
var c by property(3)
|
||||
|
||||
test fun doTest() {
|
||||
@test fun doTest() {
|
||||
var result = false
|
||||
addChangeListener("b", object: ChangeListener {
|
||||
public override fun onPropertyChange(event: ChangeEvent) {
|
||||
@@ -54,7 +54,7 @@ class ObservablePropertyTest {
|
||||
assertEquals(new, b, "New value has already been set")
|
||||
})
|
||||
|
||||
test fun doTest() {
|
||||
@test fun doTest() {
|
||||
b = 4
|
||||
assertTrue(b == 4, "fail: b != 4")
|
||||
assertTrue(result, "fail: result should be true")
|
||||
@@ -72,7 +72,7 @@ class VetoablePropertyTest {
|
||||
result
|
||||
})
|
||||
|
||||
test fun doTest() {
|
||||
@test fun doTest() {
|
||||
val firstValue = A(true)
|
||||
b = firstValue
|
||||
assertTrue(b == firstValue, "fail1: b should be firstValue = A(true)")
|
||||
|
||||
@@ -18,7 +18,7 @@ class ValByMapExtensionsTest {
|
||||
val x: Double by genericMap
|
||||
|
||||
|
||||
test fun doTest() {
|
||||
@test fun doTest() {
|
||||
assertEquals("all", a)
|
||||
assertEquals("bar", b)
|
||||
assertEquals("code", c)
|
||||
@@ -42,7 +42,7 @@ class VarByMapExtensionsTest {
|
||||
var a2: String by map2.withDefault { "empty" }
|
||||
//var x: Int by map2 // prohibited by type system
|
||||
|
||||
test fun doTest() {
|
||||
@test fun doTest() {
|
||||
assertEquals("all", a)
|
||||
assertEquals(null, b)
|
||||
assertEquals(1, c)
|
||||
|
||||
@@ -14,7 +14,7 @@ class MapValWithDifferentTypesTest() {
|
||||
val c by Delegates.mapVal<Any>(map)
|
||||
val d by Delegates.mapVal<Int?>(map)
|
||||
|
||||
test fun doTest() {
|
||||
@test fun doTest() {
|
||||
assertTrue(a == "a", "fail at 'a'")
|
||||
assertTrue(b == 1, "fail at 'b'")
|
||||
assertTrue(c == B(1), "fail at 'c'")
|
||||
@@ -29,7 +29,7 @@ class MapVarWithDifferentTypesTest() {
|
||||
var c by Delegates.mapVar<Any>(map)
|
||||
var d by Delegates.mapVar<String?>(map)
|
||||
|
||||
test fun doTest() {
|
||||
@test fun doTest() {
|
||||
a = "aa"
|
||||
b = 11
|
||||
c = B(11)
|
||||
@@ -48,7 +48,7 @@ class MapNullableKeyTest {
|
||||
val map = hashMapOf<Any?, Any?>(null to "null")
|
||||
var a by FixedMapVar<Any?, Any?, Any?>(map, key = { desc -> null }, default = {ref, desc -> null})
|
||||
|
||||
test fun doTest() {
|
||||
@test fun doTest() {
|
||||
assertTrue(a == "null", "fail at 'a'")
|
||||
a = "foo"
|
||||
assertTrue(a == "foo", "fail at 'a' after set")
|
||||
@@ -61,7 +61,7 @@ class MapPropertyStringTest() {
|
||||
var b by Delegates.mapVar<String>(map)
|
||||
val c by Delegates.mapVal<String>(map)
|
||||
|
||||
test fun doTest() {
|
||||
@test fun doTest() {
|
||||
b = "newB"
|
||||
assertTrue(a == "a", "fail at 'a'")
|
||||
assertTrue(b == "newB", "fail at 'b'")
|
||||
@@ -75,7 +75,7 @@ class MapValWithDefaultTest() {
|
||||
val b: String by FixedMapVal(map, default = { ref: MapValWithDefaultTest, desc: String -> "bDefault" }, key = {"b"})
|
||||
val c: String by FixedMapVal(map, default = { ref: MapValWithDefaultTest, desc: String -> "cDefault" }, key = { desc -> desc.name })
|
||||
|
||||
test fun doTest() {
|
||||
@test fun doTest() {
|
||||
assertTrue(a == "aDefault", "fail at 'a'")
|
||||
assertTrue(b == "bDefault", "fail at 'b'")
|
||||
assertTrue(c == "cDefault", "fail at 'c'")
|
||||
@@ -88,7 +88,7 @@ class MapVarWithDefaultTest() {
|
||||
var b: String by FixedMapVar(map, default = {ref: Any?, desc: String -> "bDefault" }, key = {"b"})
|
||||
var c: String by FixedMapVar(map, default = {ref: Any?, desc: String -> "cDefault" }, key = { desc -> desc.name })
|
||||
|
||||
test fun doTest() {
|
||||
@test fun doTest() {
|
||||
assertTrue(a == "aDefault", "fail at 'a'")
|
||||
assertTrue(b == "bDefault", "fail at 'b'")
|
||||
assertTrue(c == "cDefault", "fail at 'c'")
|
||||
@@ -106,7 +106,7 @@ class MapPropertyKeyTest() {
|
||||
val a by FixedMapVal<Any?, String, String>(map, key = {"a"})
|
||||
var b by FixedMapVar<Any?, String, String>(map, key = {"b"})
|
||||
|
||||
test fun doTest() {
|
||||
@test fun doTest() {
|
||||
b = "c"
|
||||
assertTrue(a == "a", "fail at 'a'")
|
||||
assertTrue(b == "c", "fail at 'b'")
|
||||
@@ -118,7 +118,7 @@ class MapPropertyFunctionTest() {
|
||||
val a by FixedMapVal<Any?, String, String>(map, { desc -> "${desc.name}Desc" })
|
||||
var b by FixedMapVar<Any?, String, String>(map, { desc -> "${desc.name}Desc" })
|
||||
|
||||
test fun doTest() {
|
||||
@test fun doTest() {
|
||||
b = "c"
|
||||
assertTrue(a == "a", "fail at 'a'")
|
||||
assertTrue(b == "c", "fail at 'b' after set")
|
||||
@@ -141,7 +141,7 @@ class MapPropertyCustomTest() {
|
||||
val a by mapVal
|
||||
var b by mapVar
|
||||
|
||||
test fun doTest() {
|
||||
@test fun doTest() {
|
||||
b = "newB"
|
||||
assertTrue(a == "a", "fail at 'a'")
|
||||
assertTrue(b == "newB", "fail at 'b' after set")
|
||||
@@ -167,7 +167,7 @@ class MapPropertyCustomWithDefaultTest() {
|
||||
val a by mapValWithDefault
|
||||
var b by mapVarWithDefault
|
||||
|
||||
test fun doTest() {
|
||||
@test fun doTest() {
|
||||
assertTrue(a == "default", "fail at 'a'")
|
||||
assertTrue(b == "default", "fail at 'b'")
|
||||
b = "c"
|
||||
|
||||
@@ -11,19 +11,19 @@ class LazyValTest {
|
||||
++result
|
||||
}
|
||||
|
||||
test fun doTest() {
|
||||
@test fun doTest() {
|
||||
a
|
||||
assertTrue(a == 1, "fail: initializer should be invoked only once")
|
||||
}
|
||||
}
|
||||
|
||||
class SynchronizedLazyValTest {
|
||||
volatile var result = 0
|
||||
@Volatile var result = 0
|
||||
val a by lazy(this) {
|
||||
++result
|
||||
}
|
||||
|
||||
test fun doTest() {
|
||||
@test fun doTest() {
|
||||
synchronized(this) {
|
||||
// thread { a } // not available in js // TODO: Make this test JVM-only
|
||||
result = 1
|
||||
@@ -40,7 +40,7 @@ class UnsafeLazyValTest {
|
||||
++result
|
||||
}
|
||||
|
||||
test fun doTest() {
|
||||
@test fun doTest() {
|
||||
a
|
||||
assertTrue(a == 1, "fail: initializer should be invoked only once")
|
||||
}
|
||||
@@ -53,7 +53,7 @@ class NullableLazyValTest {
|
||||
val a: Int? by lazy { resultA++; null}
|
||||
val b by lazy { foo() }
|
||||
|
||||
test fun doTest() {
|
||||
@test fun doTest() {
|
||||
a
|
||||
b
|
||||
|
||||
@@ -76,7 +76,7 @@ class UnsafeNullableLazyValTest {
|
||||
val a: Int? by lazy(LazyThreadSafetyMode.NONE) { resultA++; null}
|
||||
val b by lazy(LazyThreadSafetyMode.NONE) { foo() }
|
||||
|
||||
test fun doTest() {
|
||||
@test fun doTest() {
|
||||
a
|
||||
b
|
||||
|
||||
@@ -98,7 +98,7 @@ class UnsafeLazyValDeprecatedTest {
|
||||
++result
|
||||
}
|
||||
|
||||
test fun doTest() {
|
||||
@test fun doTest() {
|
||||
a
|
||||
assertTrue(a == 1, "fail: initializer should be invoked only once")
|
||||
}
|
||||
@@ -110,7 +110,7 @@ class BlockingLazyValDeprecatedTest {
|
||||
++result
|
||||
}
|
||||
|
||||
test fun doTest() {
|
||||
@test fun doTest() {
|
||||
a
|
||||
assertTrue(a == 1, "fail: initializer should be invoked only once")
|
||||
}
|
||||
@@ -123,7 +123,7 @@ class UnsafeNullableLazyValDeprecatedTest {
|
||||
val a: Int? by Delegates.lazy { resultA++; null}
|
||||
val b by Delegates.lazy { foo() }
|
||||
|
||||
test fun doTest() {
|
||||
@test fun doTest() {
|
||||
a
|
||||
b
|
||||
|
||||
@@ -146,7 +146,7 @@ class BlockingNullableLazyValDeprecatedTest {
|
||||
val a: Int? by Delegates.blockingLazy { resultA++; null}
|
||||
val b by Delegates.blockingLazy { foo() }
|
||||
|
||||
test fun doTest() {
|
||||
@test fun doTest() {
|
||||
a
|
||||
b
|
||||
|
||||
@@ -166,7 +166,7 @@ class IdentityEqualsIsUsedToUnescapeLazyValTest {
|
||||
var equalsCalled = 0
|
||||
val a by lazy { ClassWithCustomEquality { equalsCalled++ } }
|
||||
|
||||
test fun doTest() {
|
||||
@test fun doTest() {
|
||||
a
|
||||
a
|
||||
assertTrue(equalsCalled == 0, "fail: equals called $equalsCalled times.")
|
||||
|
||||
Reference in New Issue
Block a user