Open-source multiplayer game server compatible with the RuneScape client
https://www.openrs2.org/
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
22 lines
510 B
22 lines
510 B
3 years ago
|
package org.openrs2.util.collect
|
||
|
|
||
|
import kotlin.test.Test
|
||
|
import kotlin.test.assertEquals
|
||
|
import kotlin.test.assertFalse
|
||
|
import kotlin.test.assertNull
|
||
|
import kotlin.test.assertTrue
|
||
|
|
||
|
class UniqueQueueTest {
|
||
|
@Test
|
||
|
fun testAddPoll() {
|
||
|
val queue = UniqueQueue<String>()
|
||
|
assertTrue(queue.add("a"))
|
||
|
assertTrue(queue.add("b"))
|
||
|
assertFalse(queue.add("a"))
|
||
|
|
||
|
assertEquals("a", queue.poll())
|
||
|
assertEquals("b", queue.poll())
|
||
|
assertNull(queue.poll())
|
||
|
}
|
||
|
}
|