diff options
author | Martin Odersky <odersky@gmail.com> | 2009-05-08 16:33:15 +0000 |
---|---|---|
committer | Martin Odersky <odersky@gmail.com> | 2009-05-08 16:33:15 +0000 |
commit | 14a631a5fec42d04d0723355a0b93e482b5e4662 (patch) | |
tree | f639c2a22e89e193b9abea391993ecfd4d5326ee /test/files/run/collection-stacks.scala | |
parent | 2379eb4ebbd28c8892b50a1d9fa8a687099eea4d (diff) | |
download | scala-14a631a5fec42d04d0723355a0b93e482b5e4662.tar.gz scala-14a631a5fec42d04d0723355a0b93e482b5e4662.tar.bz2 scala-14a631a5fec42d04d0723355a0b93e482b5e4662.zip |
massive new collections checkin.
Diffstat (limited to 'test/files/run/collection-stacks.scala')
-rw-r--r-- | test/files/run/collection-stacks.scala | 38 |
1 files changed, 0 insertions, 38 deletions
diff --git a/test/files/run/collection-stacks.scala b/test/files/run/collection-stacks.scala deleted file mode 100644 index ec557cb91d..0000000000 --- a/test/files/run/collection-stacks.scala +++ /dev/null @@ -1,38 +0,0 @@ -import scala.collection._ - -object Test extends Application { - def mutableStack[T](xs: T*): mutable.Stack[T] = { - val s = new mutable.Stack[T] - s.push(xs: _*) - s - } - - def immutableStack[T](xs: T*): immutable.Stack[T] = { - immutable.Stack.Empty push xs - } - - def check[T](expected: T, got: T) { - println(got + ": " + (expected == got)) - } - - // check #957 - check("1-2-3", immutableStack(1, 2, 3).elements.mkString("-")) - check("1-2-3", mutableStack(1, 2, 3).elements.mkString("-")) - - println("apply") - check(1, immutableStack(1, 2, 3).apply(0)) - check(1, mutableStack(1, 2, 3).apply(0)) - check(3, immutableStack(1, 2, 3).apply(2)) - check(3, mutableStack(1, 2, 3).apply(2)) - - println("top") - check(3, immutableStack(1, 2, 3).top) - check(3, mutableStack(1, 2, 3).top) - - println("pop") - check("1-2", immutableStack(1, 2, 3).pop.mkString("-")) - check(3, mutableStack(1, 2, 3).pop()) - check("1-2", { val s = mutableStack(1, 2, 3); s.pop(); s.toList.mkString("-") }) -} - -// vim: set ts=2 sw=2 et: |