Skip to content

Commit

Permalink
more test on remove(element)
Browse files Browse the repository at this point in the history
penemue committed Oct 8, 2017
1 parent fcd9c43 commit a56c10d
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions src/test/kotlin/com/github/penemue/keap/PriorityQueueTests.kt
Original file line number Diff line number Diff line change
@@ -310,6 +310,20 @@ class PriorityQueueTests {
}
}

@Test
fun testRemove2() {
val q = populatedQueue(SIZE)
for (i in SIZE - 1 downTo 0) {
assertTrue(q.remove(i))
assertEquals(i, q.size)
}
try {
q.remove()
shouldThrow()
} catch (success: NoSuchElementException) {
}
}

/**
* remove(x) removes x and returns true if present
*/

0 comments on commit a56c10d

Please sign in to comment.