Skip to content

Commit bd04b2c

Browse files
committed
SI-6614 Test case for fixed ArrayStack misconduct.
Not sure when it was fixed, but in 2.9.2 things were messed up: scala> (for (i <- 0 to 10) yield { val in = ArrayStack.tabulate(i)(_.toString); (in, (in filter (_ => true)) == in) }).mkString("\n") res14: String = (ArrayStack(),true) (ArrayStack(0),true) (ArrayStack(0, 1),true) (ArrayStack(1, 2, null),false) (ArrayStack(0, 1, 2, 3),true) (ArrayStack(3, 4, null, null, null),false) (ArrayStack(2, 3, 4, 5, null, null),false) (ArrayStack(1, 2, 3, 4, 5, 6, null),false) (ArrayStack(0, 1, 2, 3, 4, 5, 6, 7),true) (ArrayStack(7, 8, null, null, null, null, null, null, null),false) (ArrayStack(6, 7, 8, 9, null, null, null, null, null, null),false)
1 parent 0acb8a3 commit bd04b2c

File tree

2 files changed

+19
-0
lines changed

2 files changed

+19
-0
lines changed

test/files/run/t6614.check

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
(ArrayStack(),true)
2+
(ArrayStack(0),true)
3+
(ArrayStack(0, 1),true)
4+
(ArrayStack(0, 1, 2),true)
5+
(ArrayStack(0, 1, 2, 3),true)
6+
(ArrayStack(0, 1, 2, 3, 4),true)
7+
(ArrayStack(0, 1, 2, 3, 4, 5),true)
8+
(ArrayStack(0, 1, 2, 3, 4, 5, 6),true)
9+
(ArrayStack(0, 1, 2, 3, 4, 5, 6, 7),true)
10+
(ArrayStack(0, 1, 2, 3, 4, 5, 6, 7, 8),true)
11+
(ArrayStack(0, 1, 2, 3, 4, 5, 6, 7, 8, 9),true)

test/files/run/t6614.scala

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
object Test extends App {
2+
import scala.collection.mutable.ArrayStack
3+
4+
println((for (i <- 0 to 10) yield {
5+
val in = ArrayStack.tabulate(i)(_.toString)
6+
(in, (in filter (_ => true)) == in)
7+
}).mkString("\n"))
8+
}

0 commit comments

Comments
 (0)