summaryrefslogtreecommitdiff
path: root/test/junit
diff options
context:
space:
mode:
authorJason Zaugg <jzaugg@gmail.com>2016-05-05 23:09:13 +1000
committerJason Zaugg <jzaugg@gmail.com>2016-05-05 23:09:13 +1000
commit2726320779356be1829aa1715888872606aa819b (patch)
treef0de3ac9511a4dd4c18ddc58ed1cce342dfa6e2e /test/junit
parentfbd2e35f7ceeab1dad04b55518b2c314e55a6851 (diff)
parent284571c74cac6c01dfa1c4af0d9d92f4f9fb04c0 (diff)
downloadscala-2726320779356be1829aa1715888872606aa819b.tar.gz
scala-2726320779356be1829aa1715888872606aa819b.tar.bz2
scala-2726320779356be1829aa1715888872606aa819b.zip
Merge pull request #5132 from acdenhartog/patch-1
Avoid function chaining with reverse method
Diffstat (limited to 'test/junit')
-rw-r--r--test/junit/scala/collection/mutable/PriorityQueueTest.scala7
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)
}
}