Migrate impl to actual in libraries projects
This commit is contained in:
@@ -22,14 +22,14 @@ import kotlin.reflect.KClass
|
|||||||
* Comments out a block of test code until it is implemented while keeping a link to the code
|
* Comments out a block of test code until it is implemented while keeping a link to the code
|
||||||
* to implement in your unit test output
|
* to implement in your unit test output
|
||||||
*/
|
*/
|
||||||
impl fun todo(block: () -> Unit) {
|
actual fun todo(block: () -> Unit) {
|
||||||
// println("TODO at " + (Exception() as java.lang.Throwable).getStackTrace()?.get(1) + " for " + block)
|
// println("TODO at " + (Exception() as java.lang.Throwable).getStackTrace()?.get(1) + " for " + block)
|
||||||
println("TODO at " + block)
|
println("TODO at " + block)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/** Asserts that a [block] fails with a specific exception of type [exceptionClass] being thrown. */
|
/** Asserts that a [block] fails with a specific exception of type [exceptionClass] being thrown. */
|
||||||
impl fun <T : Throwable> assertFailsWith(exceptionClass: KClass<T>, message: String?, block: () -> Unit): T {
|
actual fun <T : Throwable> assertFailsWith(exceptionClass: KClass<T>, message: String?, block: () -> Unit): T {
|
||||||
val exception = assertFails(message, block)
|
val exception = assertFails(message, block)
|
||||||
@Suppress("INVISIBLE_MEMBER")
|
@Suppress("INVISIBLE_MEMBER")
|
||||||
assertTrue(exceptionClass.isInstance(exception), messagePrefix(message) + "Expected an exception of $exceptionClass to be thrown, but was $exception")
|
assertTrue(exceptionClass.isInstance(exception), messagePrefix(message) + "Expected an exception of $exceptionClass to be thrown, but was $exception")
|
||||||
@@ -42,4 +42,4 @@ impl fun <T : Throwable> assertFailsWith(exceptionClass: KClass<T>, message: Str
|
|||||||
/**
|
/**
|
||||||
* Provides the JS implementation of asserter
|
* Provides the JS implementation of asserter
|
||||||
*/
|
*/
|
||||||
internal impl fun lookupAsserter(): Asserter = DefaultJsAsserter
|
internal actual fun lookupAsserter(): Asserter = DefaultJsAsserter
|
||||||
@@ -3,4 +3,4 @@ package org.junit
|
|||||||
@Deprecated("Use 'Test' from kotlin.test package",
|
@Deprecated("Use 'Test' from kotlin.test package",
|
||||||
replaceWith = ReplaceWith("Test", "kotlin.test.Test"),
|
replaceWith = ReplaceWith("Test", "kotlin.test.Test"),
|
||||||
level = DeprecationLevel.WARNING)
|
level = DeprecationLevel.WARNING)
|
||||||
impl typealias Test = kotlin.test.Test
|
actual typealias Test = kotlin.test.Test
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ private val inited = AtomicBoolean()
|
|||||||
private val lock = ReentrantLock()
|
private val lock = ReentrantLock()
|
||||||
private val contributors = ArrayList<AsserterContributor>()
|
private val contributors = ArrayList<AsserterContributor>()
|
||||||
|
|
||||||
internal impl fun lookupAsserter(): Asserter = lookup()
|
internal actual fun lookupAsserter(): Asserter = lookup()
|
||||||
|
|
||||||
private val defaultAsserter = DefaultAsserter()
|
private val defaultAsserter = DefaultAsserter()
|
||||||
|
|
||||||
|
|||||||
@@ -43,7 +43,7 @@ private fun <T : Throwable> assertFailsWithImpl(exceptionClass: Class<T>, messag
|
|||||||
|
|
||||||
|
|
||||||
/** Asserts that a [block] fails with a specific exception of type [exceptionClass] being thrown. */
|
/** Asserts that a [block] fails with a specific exception of type [exceptionClass] being thrown. */
|
||||||
impl fun <T : Throwable> assertFailsWith(exceptionClass: KClass<T>, message: String?, block: () -> Unit): T = assertFailsWithImpl(exceptionClass.java, message, block)
|
actual fun <T : Throwable> assertFailsWith(exceptionClass: KClass<T>, message: String?, block: () -> Unit): T = assertFailsWithImpl(exceptionClass.java, message, block)
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -51,7 +51,7 @@ impl fun <T : Throwable> assertFailsWith(exceptionClass: KClass<T>, message: Str
|
|||||||
* to implement in your unit test output
|
* to implement in your unit test output
|
||||||
*/
|
*/
|
||||||
@InlineOnly
|
@InlineOnly
|
||||||
impl inline fun todo(@Suppress("UNUSED_PARAMETER") block: () -> Unit) {
|
actual inline fun todo(@Suppress("UNUSED_PARAMETER") block: () -> Unit) {
|
||||||
System.out.println("TODO at " + currentStackTrace()[0])
|
System.out.println("TODO at " + currentStackTrace()[0])
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+2
-2
@@ -1,5 +1,5 @@
|
|||||||
package foo
|
package foo
|
||||||
|
|
||||||
impl class PlatformClass {
|
actual class PlatformClass {
|
||||||
impl val value: String = "JS"
|
actual val value: String = "JS"
|
||||||
}
|
}
|
||||||
+2
-2
@@ -1,5 +1,5 @@
|
|||||||
package foo
|
package foo
|
||||||
|
|
||||||
impl class PlatformTest {
|
actual class PlatformTest {
|
||||||
impl val value: PlatformClass = PlatformClass()
|
actual val value: PlatformClass = PlatformClass()
|
||||||
}
|
}
|
||||||
+2
-2
@@ -1,5 +1,5 @@
|
|||||||
package foo
|
package foo
|
||||||
|
|
||||||
impl class PlatformClass {
|
actual class PlatformClass {
|
||||||
impl val value: String = "JVM"
|
actual val value: String = "JVM"
|
||||||
}
|
}
|
||||||
+2
-2
@@ -1,5 +1,5 @@
|
|||||||
package foo
|
package foo
|
||||||
|
|
||||||
impl class PlatformTest {
|
actual class PlatformTest {
|
||||||
impl val value: PlatformClass = PlatformClass()
|
actual val value: PlatformClass = PlatformClass()
|
||||||
}
|
}
|
||||||
+1
-1
@@ -4,6 +4,6 @@ fun main(args: Array<String>) {
|
|||||||
doMain()
|
doMain()
|
||||||
}
|
}
|
||||||
|
|
||||||
impl fun doMain() {
|
actual fun doMain() {
|
||||||
console.info(getGreeting())
|
console.info(getGreeting())
|
||||||
}
|
}
|
||||||
|
|||||||
+1
-1
@@ -4,6 +4,6 @@ fun main(args : Array<String>) {
|
|||||||
doMain()
|
doMain()
|
||||||
}
|
}
|
||||||
|
|
||||||
impl fun doMain() {
|
actual fun doMain() {
|
||||||
System.out?.println(getGreeting())
|
System.out?.println(getGreeting())
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user