Skip to content

Commit

Permalink
Update SnowflakeTest
Browse files Browse the repository at this point in the history
  • Loading branch information
DRSchlaubi committed Feb 28, 2023
1 parent 566667b commit f8e71b3
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions common/src/commonTest/kotlin/entity/SnowflakeTest.kt
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@ class SnowflakeTest {
}

@Test
@JsName("test12")
fun `Snowflakes are compared correctly`() {
// timestamp worker process increment
// vvv vvv vvv vvv
Expand Down Expand Up @@ -130,11 +131,12 @@ class SnowflakeTest {
}

@Test
@JsName("test13")
fun `Snowflake's natural order works with SortedSets`() {
val a = Snowflake(0b0_00000_00000_000000000000_u)
val b = Snowflake(0b0_00000_00000_000000000001_u)
val c = Snowflake(0b1_00000_00000_000000000000_u)
assertEquals(2, sortedSetOf(a, b).size)
assertEquals(2, sortedSetOf(a, c).size)
assertEquals(2, setOf(a, b).size)
assertEquals(2, setOf(a, c).size)
}
}

0 comments on commit f8e71b3

Please sign in to comment.