Fix JvmBuildMetaInfoTest.testSerialization
Do not check against hard-coded values of parameters, because they might be changed a lot in the future
This commit is contained in:
@@ -19,6 +19,8 @@ package org.jetbrains.kotlin.build
|
|||||||
import junit.framework.TestCase
|
import junit.framework.TestCase
|
||||||
import org.jetbrains.kotlin.cli.common.arguments.K2JVMCompilerArguments
|
import org.jetbrains.kotlin.cli.common.arguments.K2JVMCompilerArguments
|
||||||
import org.jetbrains.kotlin.config.KotlinCompilerVersion
|
import org.jetbrains.kotlin.config.KotlinCompilerVersion
|
||||||
|
import org.jetbrains.kotlin.config.LanguageFeature
|
||||||
|
import org.jetbrains.kotlin.load.kotlin.JvmMetadataVersion
|
||||||
import org.junit.Assert.assertNotEquals
|
import org.junit.Assert.assertNotEquals
|
||||||
import org.junit.Test
|
import org.junit.Test
|
||||||
|
|
||||||
@@ -28,27 +30,26 @@ class JvmBuildMetaInfoTest : TestCase() {
|
|||||||
val args = K2JVMCompilerArguments()
|
val args = K2JVMCompilerArguments()
|
||||||
val info = JvmBuildMetaInfo(args)
|
val info = JvmBuildMetaInfo(args)
|
||||||
val actual = JvmBuildMetaInfo.serializeToString(info)
|
val actual = JvmBuildMetaInfo.serializeToString(info)
|
||||||
val expectedTempalte =
|
val expectedKeys = listOf(
|
||||||
"""apiVersionString=1.1
|
"apiVersionString",
|
||||||
bytecodeVersionMajor=1
|
"bytecodeVersionMajor",
|
||||||
bytecodeVersionMinor=0
|
"bytecodeVersionMinor",
|
||||||
bytecodeVersionPatch=1
|
"bytecodeVersionPatch",
|
||||||
compilerBuildVersion=@snapshot@
|
"compilerBuildVersion",
|
||||||
coroutinesEnable=false
|
"coroutinesEnable",
|
||||||
coroutinesError=false
|
"coroutinesError",
|
||||||
coroutinesVersion=0
|
"coroutinesVersion",
|
||||||
coroutinesWarn=false
|
"coroutinesWarn",
|
||||||
isEAP=@isEAP@
|
"isEAP",
|
||||||
languageVersionString=1.1
|
"languageVersionString",
|
||||||
metadataVersionMajor=1
|
"metadataVersionMajor",
|
||||||
metadataVersionMinor=1
|
"metadataVersionMinor",
|
||||||
metadataVersionPatch=3
|
"metadataVersionPatch",
|
||||||
multiplatformEnable=false
|
"multiplatformEnable",
|
||||||
multiplatformVersion=0
|
"multiplatformVersion",
|
||||||
ownVersion=0"""
|
"ownVersion"
|
||||||
val expected = expectedTempalte.replace("@snapshot@", KotlinCompilerVersion.VERSION)
|
)
|
||||||
.replace("@isEAP@", KotlinCompilerVersion.IS_PRE_RELEASE.toString())
|
assertEquals(expectedKeys, actual.split("\r\n", "\n").map { line -> line.split("=").first() })
|
||||||
assertEquals(expected, actual)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
|
|||||||
Reference in New Issue
Block a user