-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
made latest a special value in compare function
- Loading branch information
Showing
2 changed files
with
44 additions
and
1 deletion.
There are no files selected for viewing
38 changes: 38 additions & 0 deletions
38
kirc-core/src/test/kotlin/de/cmdjulian/kirc/image/TagTest.kt
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,38 @@ | ||
package de.cmdjulian.kirc.image | ||
|
||
import io.kotest.matchers.comparables.shouldBeEqualComparingTo | ||
import io.kotest.matchers.comparables.shouldBeGreaterThan | ||
import io.kotest.matchers.comparables.shouldBeLessThan | ||
import org.junit.jupiter.api.Test | ||
|
||
class TagTest { | ||
@Test | ||
fun `should be equal for latest`() { | ||
Tag.LATEST shouldBeEqualComparingTo Tag.LATEST | ||
} | ||
|
||
@Test | ||
fun `should be equal`() { | ||
Tag("1.2.0") shouldBeEqualComparingTo Tag("1.2.0") | ||
} | ||
|
||
@Test | ||
fun `should be smaller`() { | ||
Tag("1.2") shouldBeLessThan Tag("1.3") | ||
} | ||
|
||
@Test | ||
fun `should be bigger`() { | ||
Tag("1.3") shouldBeGreaterThan Tag("1.2") | ||
} | ||
|
||
@Test | ||
fun `latest is always greater`() { | ||
Tag.LATEST shouldBeGreaterThan Tag("99999999") | ||
} | ||
|
||
@Test | ||
fun `nothing is greater than latest`() { | ||
Tag("99999999") shouldBeLessThan Tag.LATEST | ||
} | ||
} |
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