Write patch version for VersionRequirement correctly
This commit is contained in:
+1
-1
@@ -615,7 +615,7 @@ class DescriptorSerializer private constructor(
|
||||
|
||||
val major = matchResult.groupValues.getOrNull(1)?.toIntOrNull() ?: return null
|
||||
val minor = matchResult.groupValues.getOrNull(2)?.toIntOrNull() ?: 0
|
||||
val patch = matchResult.groupValues.getOrNull(3)?.toIntOrNull() ?: 0
|
||||
val patch = matchResult.groupValues.getOrNull(4)?.toIntOrNull() ?: 0
|
||||
|
||||
val proto = ProtoBuf.VersionRequirement.newBuilder()
|
||||
VersionRequirement.Version(major, minor, patch).encode(
|
||||
|
||||
@@ -0,0 +1,7 @@
|
||||
@file:Suppress("INVISIBLE_MEMBER", "INVISIBLE_REFERENCE")
|
||||
package test
|
||||
|
||||
import kotlin.internal.RequireKotlin
|
||||
|
||||
@RequireKotlin("1.1.50", level = DeprecationLevel.HIDDEN)
|
||||
class Klass
|
||||
@@ -139,4 +139,10 @@ class VersionRequirementTest : TestCaseWithTmpdir() {
|
||||
"test.property"
|
||||
)
|
||||
}
|
||||
|
||||
fun testPatchVersion() {
|
||||
doTest(VersionRequirement.Version(1, 1, 50), DeprecationLevel.HIDDEN, null, ProtoBuf.VersionRequirement.VersionKind.LANGUAGE_VERSION, null,
|
||||
"test.Klass"
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user