From a40951d65d21eea37f473fdc7a554abbc1904694 Mon Sep 17 00:00:00 2001 From: Mikhail Glukhikh Date: Tue, 19 Sep 2023 13:53:25 +0200 Subject: [PATCH] Reformat KotlinVersionsTest --- .../kotlin/util/KotlinVersionsTest.kt | 36 +++++++++---------- 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/compiler/tests/org/jetbrains/kotlin/util/KotlinVersionsTest.kt b/compiler/tests/org/jetbrains/kotlin/util/KotlinVersionsTest.kt index 95cb601eecb..dee29256539 100644 --- a/compiler/tests/org/jetbrains/kotlin/util/KotlinVersionsTest.kt +++ b/compiler/tests/org/jetbrains/kotlin/util/KotlinVersionsTest.kt @@ -38,8 +38,8 @@ class KotlinVersionsTest : KtUsefulTestCase() { data class Version(val major: Int, val minor: Int, val patch: Int?, val versionString: String, val source: String) { fun isConsistentWith(other: Version): Boolean { return major == other.major && - minor == other.minor && - (patch == null || other.patch == null || patch == other.patch) + minor == other.minor && + (patch == null || other.patch == null || patch == other.patch) } } @@ -50,37 +50,37 @@ class KotlinVersionsTest : KtUsefulTestCase() { } fun String.toVersion(source: String): Version = - toVersionOrNull(source) ?: error("Version ($source) is in an unknown format: $this") + toVersionOrNull(source) ?: error("Version ($source) is in an unknown format: $this") val versions = arrayListOf() // This version is null in case of a local build when KotlinCompilerVersion.VERSION = "@snapshot@" versions.addIfNotNull( - KotlinCompilerVersion.VERSION.substringBefore('-').toVersionOrNull("KotlinCompilerVersion.VERSION") + KotlinCompilerVersion.VERSION.substringBefore('-').toVersionOrNull("KotlinCompilerVersion.VERSION") ) versions.add( - ForTestCompileRuntime.runtimeJarClassLoader().loadClass(KotlinVersion::class.qualifiedName!!) - .getDeclaredField(KotlinVersion.Companion::CURRENT.name) - .get(null) - .toString() - .toVersion("KotlinVersion.CURRENT") + ForTestCompileRuntime.runtimeJarClassLoader().loadClass(KotlinVersion::class.qualifiedName!!) + .getDeclaredField(KotlinVersion.Companion::CURRENT.name) + .get(null) + .toString() + .toVersion("KotlinVersion.CURRENT") ) versions.add( - loadValueFromPomXml("libraries/pom.xml", listOf("project", "version")) - ?.toVersion("version in pom.xml") + loadValueFromPomXml("libraries/pom.xml", listOf("project", "version")) + ?.toVersion("version in pom.xml") ?: error("No version in libraries/pom.xml") ) versions.add( - LanguageVersion.LATEST_STABLE.versionString.toVersion("LanguageVersion.LATEST_STABLE") + LanguageVersion.LATEST_STABLE.versionString.toVersion("LanguageVersion.LATEST_STABLE") ) if (versions.any { v1 -> versions.any { v2 -> !v1.isConsistentWith(v2) } }) { Assert.fail( - "Some versions are inconsistent. Please change the versions so that they are consistent:\n\n" + - versions.joinToString(separator = "\n") { with(it) { "$versionString ($source)" } } + "Some versions are inconsistent. Please change the versions so that they are consistent:\n\n" + + versions.joinToString(separator = "\n") { with(it) { "$versionString ($source)" } } ) } } @@ -103,14 +103,14 @@ class KotlinVersionsTest : KtUsefulTestCase() { } Assert.assertTrue( - "Too few (<= 10) pom.xml files found. Something must be wrong in the test or in the project structure", - poms.size > 10 + "Too few (<= 10) pom.xml files found. Something must be wrong in the test or in the project structure", + poms.size > 10 ) if (!poms.map(Pom::version).areEqual()) { Assert.fail( - "Some versions in pom.xml files are different. Please change the versions so that they are equal:\n\n" + - poms.joinToString(separator = "\n") { (path, version) -> "$version $path" } + "Some versions in pom.xml files are different. Please change the versions so that they are equal:\n\n" + + poms.joinToString(separator = "\n") { (path, version) -> "$version $path" } ) } }