Skip to content

Commit 7fda2e8

Browse files
authored
test: add tests for Version.isMajorVersion (#1672)
Part of #1670. Adding the test before fixing behavior of this method.
1 parent 4ff06a8 commit 7fda2e8

File tree

1 file changed

+23
-0
lines changed
  • shared-internal/src/test/kotlin/io/github/typesafegithub/workflows/shared/internal/model

1 file changed

+23
-0
lines changed
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
package io.github.typesafegithub.workflows.shared.internal.model
2+
3+
import io.kotest.core.spec.style.FunSpec
4+
import io.kotest.matchers.shouldBe
5+
6+
class VersionTest :
7+
FunSpec({
8+
context("isMajorVersion") {
9+
listOf(
10+
Pair("v1.2.3", false),
11+
Pair("v1.2", false),
12+
Pair("v3", true),
13+
Pair("V3", true),
14+
// Incorrect behavior, will be fixed in https://github.com/typesafegithub/github-workflows-kt/issues/1670
15+
Pair("v3-prerelease", true),
16+
Pair("beta-v3", true),
17+
).forEach { (version, isMajor) ->
18+
test("isMajorVersion works correctly for $version") {
19+
Version(version).isMajorVersion() shouldBe isMajor
20+
}
21+
}
22+
}
23+
})

0 commit comments

Comments
 (0)