Skip to content

Commit bb9984c

Browse files
committed
Changed InsertionOrderSet to not reverse the passed in List, matching what its name should do.
1 parent 695801c commit bb9984c

File tree

4 files changed

+8
-10
lines changed

4 files changed

+8
-10
lines changed

scalatest-test/src/test/scala/org/scalatest/InsertionOrderSetSpec.scala

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -30,13 +30,11 @@ class InsertionOrderSetSpec extends FunSpec with Matchers {
3030
InsertionOrderSet(List(1, 2, 3)) + 4 shouldBe InsertionOrderSet(List(1, 2, 3, 4))
3131
}
3232
it("should return Iterator that iterates elements in the order they were inserted") {
33-
pendingUntilFixed {
34-
val set = InsertionOrderSet(List(2, 1, 3))
35-
val itr = set.iterator
36-
itr.next shouldBe 2
37-
itr.next shouldBe 1
38-
itr.next shouldBe 3
39-
}
33+
val set = InsertionOrderSet(List(2, 1, 3))
34+
val itr = set.iterator
35+
itr.next shouldBe 2
36+
itr.next shouldBe 1
37+
itr.next shouldBe 3
4038
}
4139
it("should return true when contains is called with element it contains") {
4240
val set = InsertionOrderSet(List(2, 1, 3))

scalatest/src/main/scala/org/scalatest/AsyncEngine.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -751,7 +751,7 @@ private[scalatest] sealed abstract class AsyncSuperEngine[T](concurrentBundleMod
751751

752752
val testLeaf = TestLeaf(currentBranch, testName, testText, testFun, testLocation, Some(pos), duration)
753753
testsMap += (testName -> testLeaf)
754-
testNamesList ::= testName
754+
testNamesList = testNamesList :+ testName
755755
currentBranch.subNodes ::= testLeaf
756756

757757
val tagNames = Set[String]() ++ testTags.map(_.name)

scalatest/src/main/scala/org/scalatest/Engine.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -673,7 +673,7 @@ private[scalatest] sealed abstract class SuperEngine[T](concurrentBundleModMessa
673673

674674
val testLeaf = TestLeaf(currentBranch, testName, testText, testFun, testLocation, pos, duration, informer)
675675
testsMap += (testName -> testLeaf)
676-
testNamesList ::= testName
676+
testNamesList = testNamesList :+ testName
677677
currentBranch.subNodes ::= testLeaf
678678

679679
val tagNames = Set[String]() ++ testTags.map(_.name)

scalatest/src/main/scala/org/scalatest/InsertionOrderSet.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ package org.scalatest
1717

1818
private[scalatest] class InsertionOrderSet[A](elements: List[A]) extends Set[A] {
1919

20-
val list = elements.distinct.reverse
20+
val list = elements.distinct
2121

2222
def contains(key: A): Boolean = list.contains(key)
2323
def iterator: Iterator[A] = list.iterator

0 commit comments

Comments
 (0)