1
0
Fork 0
mirror of https://github.com/ethauvin/kobalt.git synced 2025-04-26 08:27:12 -07:00

VersionTest.

This commit is contained in:
Cedric Beust 2017-03-01 10:12:54 -08:00
parent f10749adae
commit e9b1636727

View 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)
}
}