mirror of
https://github.com/mamoe/mirai.git
synced 2025-01-10 18:40:15 +08:00
Remove redundant code
This commit is contained in:
parent
a49efda337
commit
f990b7ce8c
@ -96,16 +96,6 @@ internal class TestSemVersion {
|
|||||||
|
|
||||||
@Test
|
@Test
|
||||||
internal fun testSemVersionParsing() {
|
internal fun testSemVersionParsing() {
|
||||||
fun String.check() {
|
|
||||||
val sem = SemVersion.parse(this)
|
|
||||||
assert(this == sem.toString()) { "$this != $sem" }
|
|
||||||
}
|
|
||||||
|
|
||||||
fun String.checkInvalid() {
|
|
||||||
kotlin.runCatching { SemVersion.parse(this) }
|
|
||||||
.onSuccess { assert(false) { "$this not a invalid sem-version" } }
|
|
||||||
.onFailure { println("$this - $it") }
|
|
||||||
}
|
|
||||||
"0.0".check()
|
"0.0".check()
|
||||||
"1.0.0".check()
|
"1.0.0".check()
|
||||||
"1.2.3.4.5.6.7.8".checkInvalid()
|
"1.2.3.4.5.6.7.8".checkInvalid()
|
||||||
|
Loading…
Reference in New Issue
Block a user