From a56c10d5b5306ad838d3e17d4a902d7e3e453c71 Mon Sep 17 00:00:00 2001 From: Vyacheslav Lukianov Date: Sun, 8 Oct 2017 16:55:48 +0300 Subject: [PATCH] more test on remove(element) --- .../com/github/penemue/keap/PriorityQueueTests.kt | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/test/kotlin/com/github/penemue/keap/PriorityQueueTests.kt b/src/test/kotlin/com/github/penemue/keap/PriorityQueueTests.kt index 84e1aa9..74a0c43 100644 --- a/src/test/kotlin/com/github/penemue/keap/PriorityQueueTests.kt +++ b/src/test/kotlin/com/github/penemue/keap/PriorityQueueTests.kt @@ -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 */