This repository was archived by the owner on Mar 21, 2023. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
23 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
package klib | ||
|
||
import klib.exceptions.InvalidTypeException | ||
import kotlin.test.assertFailsWith | ||
import kotlin.test.assertTrue | ||
import org.junit.Test | ||
|
||
class SemVerTest { | ||
@Test | ||
fun `SemVer is able to parse a valid Version string`() { | ||
val sv = SemVer.parse("1.3.4-rc+b100") | ||
assertTrue { | ||
sv.major == 1 && sv.minor == 3 && sv.patch == 4 && sv.preRelease == "rc" && sv.buildMetadata == "b100" | ||
} | ||
} | ||
|
||
@Test | ||
fun `SemVer throws a InvalidTypeException when trying to parse an invalid Version string`() { | ||
assertFailsWith<InvalidTypeException> { | ||
SemVer.parse("1.3.4_-rc+b100") | ||
} | ||
} | ||
} |