summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorAleksandar Pokopec <aleksandar.prokopec@epfl.ch>2011-05-04 14:36:42 +0000
committerAleksandar Pokopec <aleksandar.prokopec@epfl.ch>2011-05-04 14:36:42 +0000
commit00f6d557ed23f18868b85bd23c790ffd5c044867 (patch)
tree6aec508b4a2ca6d6f9a3df370ef363e7884c3387 /test
parente573f9b206f5822dce5f9ce86c5d680a5538cf90 (diff)
downloadscala-00f6d557ed23f18868b85bd23c790ffd5c044867.tar.gz
scala-00f6d557ed23f18868b85bd23c790ffd5c044867.tar.bz2
scala-00f6d557ed23f18868b85bd23c790ffd5c044867.zip
Fixes and closes #4535.
No review.
Diffstat (limited to 'test')
-rw-r--r--test/files/run/t4535.check3
-rw-r--r--test/files/run/t4535.scala30
2 files changed, 33 insertions, 0 deletions
diff --git a/test/files/run/t4535.check b/test/files/run/t4535.check
new file mode 100644
index 0000000000..9d4ce0d535
--- /dev/null
+++ b/test/files/run/t4535.check
@@ -0,0 +1,3 @@
+ArrayStack(1, 2, 3)
+ArrayStack(1, 2, 3, 4, 5, 6)
+ArrayStack(6, 5, 4, 3, 2, 1) \ No newline at end of file
diff --git a/test/files/run/t4535.scala b/test/files/run/t4535.scala
new file mode 100644
index 0000000000..91c13a28cd
--- /dev/null
+++ b/test/files/run/t4535.scala
@@ -0,0 +1,30 @@
+
+
+import collection._
+
+
+// #4535
+object Test {
+
+ def main(args: Array[String]) {
+ val as = new mutable.ArrayStack[Int]
+ as push 1
+ as push 2
+ as push 3
+ println(as.reverse)
+
+ as push 4
+ as push 5
+ as push 6
+ println(as.reverse)
+
+ println(as map { x => x })
+
+ for (i <- 0 until 100) {
+ as push i
+ assert(as == as.map(x => x))
+ assert(as == as.reverse.reverse)
+ }
+ }
+
+}