diff --git a/common/src/commonTest/kotlin/BitSetTests.kt b/common/src/commonTest/kotlin/BitSetTests.kt index 0360bdfdf60..2ff2c4f401c 100644 --- a/common/src/commonTest/kotlin/BitSetTests.kt +++ b/common/src/commonTest/kotlin/BitSetTests.kt @@ -1,6 +1,8 @@ package dev.kord.common import kotlin.js.JsName +import kotlin.random.Random +import kotlin.random.nextLong import kotlin.test.* class BitSetTests { @@ -99,4 +101,29 @@ class BitSetTests { DiscordBitSet(0b1011, 0b111001, 0b110).binary, ) } + + @Test + fun value_works_for_DiscordBitSet_with_empty_data_array() { + val bits = DiscordBitSet(data = LongArray(size = 0)) + assertEquals("0", bits.value) + } + + @Test + fun value_works_for_all_single_bit_Longs() { + for (shift in 0..