[TEST] Extract compiler-specific test utils from :tests-common to new module
This commit is contained in:
+1
-1
@@ -5,8 +5,8 @@
|
||||
|
||||
package org.jetbrains.kotlin.test.model
|
||||
|
||||
import org.jetbrains.kotlin.test.Assertions
|
||||
import org.jetbrains.kotlin.test.directives.model.DirectivesContainer
|
||||
import org.jetbrains.kotlin.test.services.Assertions
|
||||
import org.jetbrains.kotlin.test.services.ServiceRegistrationData
|
||||
import org.jetbrains.kotlin.test.services.TestServices
|
||||
import org.jetbrains.kotlin.test.services.assertions
|
||||
|
||||
+3
-22
@@ -5,27 +5,8 @@
|
||||
|
||||
package org.jetbrains.kotlin.test.services
|
||||
|
||||
import java.io.File
|
||||
import org.jetbrains.kotlin.test.Assertions
|
||||
|
||||
abstract class Assertions : TestService {
|
||||
fun assertEqualsToFile(expectedFile: File, actual: String, sanitizer: (String) -> String = { it }) {
|
||||
assertEqualsToFile(expectedFile, actual, sanitizer) { "Actual data differs from file content" }
|
||||
}
|
||||
abstract class AssertionsService : Assertions(), TestService
|
||||
|
||||
abstract fun assertEqualsToFile(
|
||||
expectedFile: File,
|
||||
actual: String,
|
||||
sanitizer: (String) -> String = { it },
|
||||
message: (() -> String)
|
||||
)
|
||||
|
||||
abstract fun assertEquals(expected: Any?, actual: Any?, message: (() -> String)? = null)
|
||||
abstract fun assertNotEquals(expected: Any?, actual: Any?, message: (() -> String)? = null)
|
||||
abstract fun assertTrue(value: Boolean, message: (() -> String)? = null)
|
||||
abstract fun assertFalse(value: Boolean, message: (() -> String)? = null)
|
||||
abstract fun assertAll(exceptions: List<AssertionError>)
|
||||
|
||||
abstract fun fail(message: () -> String): Nothing
|
||||
}
|
||||
|
||||
val TestServices.assertions: Assertions by TestServices.testServiceAccessor()
|
||||
val TestServices.assertions: AssertionsService by TestServices.testServiceAccessor()
|
||||
|
||||
+1
@@ -5,6 +5,7 @@
|
||||
|
||||
package org.jetbrains.kotlin.test.services
|
||||
|
||||
import org.jetbrains.kotlin.test.Assertions
|
||||
import org.jetbrains.kotlin.test.model.*
|
||||
|
||||
abstract class DependencyProvider : TestService {
|
||||
|
||||
+1
-1
@@ -5,8 +5,8 @@
|
||||
|
||||
package org.jetbrains.kotlin.test.services.impl
|
||||
|
||||
import org.jetbrains.kotlin.test.Assertions
|
||||
import org.jetbrains.kotlin.test.directives.model.*
|
||||
import org.jetbrains.kotlin.test.services.Assertions
|
||||
|
||||
class RegisteredDirectivesParser(private val container: DirectivesContainer, private val assertions: Assertions) {
|
||||
companion object {
|
||||
|
||||
Reference in New Issue
Block a user