mirror of
https://github.com/ethauvin/kobalt.git
synced 2025-04-26 08:27:12 -07:00
VersionTest.
This commit is contained in:
parent
f10749adae
commit
e9b1636727
1 changed files with 25 additions and 0 deletions
25
src/test/kotlin/com/beust/kobalt/internal/VersionTest.kt
Normal file
25
src/test/kotlin/com/beust/kobalt/internal/VersionTest.kt
Normal file
|
@ -0,0 +1,25 @@
|
||||||
|
package com.beust.kobalt.internal
|
||||||
|
|
||||||
|
import com.beust.kobalt.misc.Versions
|
||||||
|
import org.assertj.core.api.Assertions.assertThat
|
||||||
|
import org.testng.annotations.DataProvider
|
||||||
|
import org.testng.annotations.Test
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Make sure we parse version numbers correctly.
|
||||||
|
*/
|
||||||
|
class VersionTest {
|
||||||
|
|
||||||
|
@DataProvider
|
||||||
|
fun dp() : Array<Array<Any>>
|
||||||
|
= arrayOf(
|
||||||
|
arrayOf("0.938", 9380000),
|
||||||
|
arrayOf("1.2", 100020000L),
|
||||||
|
arrayOf("1.2.3", 100020003L)
|
||||||
|
)
|
||||||
|
|
||||||
|
@Test(dataProvider = "dp")
|
||||||
|
fun versionConversionShouldWork(version: String, expected: Long) {
|
||||||
|
assertThat(Versions.toLongVersion(version)).isEqualTo(expected)
|
||||||
|
}
|
||||||
|
}
|
Loading…
Add table
Add a link
Reference in a new issue