diff options
author | Arno den Hartog <ac.denhartog@student.maastrichtuniversity.nl> | 2016-05-02 22:08:35 +0200 |
---|---|---|
committer | Arno den Hartog <ac.denhartog@student.maastrichtuniversity.nl> | 2016-05-02 22:08:35 +0200 |
commit | 284571c74cac6c01dfa1c4af0d9d92f4f9fb04c0 (patch) | |
tree | 2a57de79f389e09e07f4962d1fd217ebf4913529 /test/junit | |
parent | 24f68829749eb00fa0cdbd6624dcfa167e5c2ce9 (diff) | |
download | scala-284571c74cac6c01dfa1c4af0d9d92f4f9fb04c0.tar.gz scala-284571c74cac6c01dfa1c4af0d9d92f4f9fb04c0.tar.bz2 scala-284571c74cac6c01dfa1c4af0d9d92f4f9fb04c0.zip |
test PriorityQueue.reverse
Diffstat (limited to 'test/junit')
-rw-r--r-- | test/junit/scala/collection/mutable/PriorityQueueTest.scala | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/test/junit/scala/collection/mutable/PriorityQueueTest.scala b/test/junit/scala/collection/mutable/PriorityQueueTest.scala index a14f1bf4c8..faedcf11f0 100644 --- a/test/junit/scala/collection/mutable/PriorityQueueTest.scala +++ b/test/junit/scala/collection/mutable/PriorityQueueTest.scala @@ -14,6 +14,12 @@ class PriorityQueueTest { priorityQueue.enqueue(elements :_*) @Test + def orderingReverseReverse() { + val pq = new mutable.PriorityQueue[Nothing]()((_,_)=>42) + assert(pq.ord eq pq.reverse.reverse.ord) + } + + @Test def canSerialize() { val outputStream = new ByteArrayOutputStream() new ObjectOutputStream(outputStream).writeObject(priorityQueue) @@ -27,6 +33,7 @@ class PriorityQueueTest { val objectInputStream = new ObjectInputStream(new ByteArrayInputStream(bytes)) val deserializedPriorityQueue = objectInputStream.readObject().asInstanceOf[PriorityQueue[Int]] + //correct sequencing is also tested here: assert(deserializedPriorityQueue.dequeueAll == elements.sorted.reverse) } } |