Migrate impl to actual in libraries projects

This commit is contained in:
Stanislav Erokhin
2017-09-15 15:55:55 +03:00
parent 481cbd0850
commit 91a99b4726
10 changed files with 17 additions and 17 deletions
@@ -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])
} }
@@ -1,5 +1,5 @@
package foo package foo
impl class PlatformClass { actual class PlatformClass {
impl val value: String = "JS" actual val value: String = "JS"
} }
@@ -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,5 +1,5 @@
package foo package foo
impl class PlatformClass { actual class PlatformClass {
impl val value: String = "JVM" actual val value: String = "JVM"
} }
@@ -1,5 +1,5 @@
package foo package foo
impl class PlatformTest { actual class PlatformTest {
impl val value: PlatformClass = PlatformClass() actual val value: PlatformClass = PlatformClass()
} }
@@ -4,6 +4,6 @@ fun main(args: Array<String>) {
doMain() doMain()
} }
impl fun doMain() { actual fun doMain() {
console.info(getGreeting()) console.info(getGreeting())
} }
@@ -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())
} }