summaryrefslogtreecommitdiff
path: root/test/pending/run/collections.scala
diff options
context:
space:
mode:
authorPaul Phillips <paulp@improving.org>2010-10-02 23:19:16 +0000
committerPaul Phillips <paulp@improving.org>2010-10-02 23:19:16 +0000
commit943fbb1363345fdaca55e5df95059e8ce8c1344b (patch)
treeb12582afc26fe0e3d0dc4a502eef5e6a2d41bfb3 /test/pending/run/collections.scala
parent06aa1c9eff49d5190e82a72a876d7b3bd706d6d4 (diff)
downloadscala-943fbb1363345fdaca55e5df95059e8ce8c1344b.tar.gz
scala-943fbb1363345fdaca55e5df95059e8ce8c1344b.tar.bz2
scala-943fbb1363345fdaca55e5df95059e8ce8c1344b.zip
The next batch of tests put up a little more st...
The next batch of tests put up a little more struggle, but only a little. See test/pending/pos/unappgadteval.scala (the changes for which were in the previous commit) for an example of a test which might be on to something. Any idea what it would take to get it working? // the key lines case i @ Suc() => { (y: Int) => y + 1 } // a = Int => Int case f @ Lam[b,c](x, e) => { (y: b) => eval(e, env.extend(x, y)) } // a = b=>c No review.
Diffstat (limited to 'test/pending/run/collections.scala')
-rw-r--r--test/pending/run/collections.scala102
1 files changed, 0 insertions, 102 deletions
diff --git a/test/pending/run/collections.scala b/test/pending/run/collections.scala
deleted file mode 100644
index 16a3ddb370..0000000000
--- a/test/pending/run/collections.scala
+++ /dev/null
@@ -1,102 +0,0 @@
-import collection._
-
-object Test extends Application {
-
- val printTime = false
-
- def sum[A](xs: Iterable[Int]) = (0 /: xs)((x, y) => x + y)
-
- def time(op: => Unit): Unit = {
- val start = System.currentTimeMillis;
- op
- if (printTime) Console.println(" time = "+(System.currentTimeMillis - start)+"ms")
- }
-
- def test(msg: String, s0: collection.immutable.Set[Int]) = {
- Console.println("***** "+msg+":")
- var s = s0
- s = s + 2
- s = s + (3, 4000, 10000)
- Console.println("test1: "+sum(s))
- time {
- s = s ++ (List.range(0, 5000) map (2*))
- Console.println("test2: "+sum(s))
- }
- time {
- var x = 0
- for (val i <- (0 to 10000))
- if (s contains i) x = x + i
- Console.println("test3: "+x)
- }
- }
-
- def test(msg: String, s0: collection.mutable.Set[Int]) = {
- Console.println("***** "+msg+":")
- var s = s0
- s = s + 2
- s = s + (3, 4000, 10000)
- Console.println("test1: "+sum(s))
- time {
- s = s ++ (List.range(0, 5000) map (2*))
- Console.println("test2: "+sum(s))
- }
- time {
- var x = 0
- for (val i <- (0 to 10000))
- if (s contains i) x = x + i
- Console.println("test3: "+x)
- }
- }
-
- def test(msg: String, s0: collection.immutable.Map[Int, Int]) = {
- Console.println("***** "+msg+":")
- var s = s0
- s = s + (2 -> 2)
- s = s + (3 -> 3, 4000 -> 4000, 10000 -> 10000)
- Console.println("test1: "+sum(s map (._2)))
- time {
- s = s ++ (List.range(0, 1000) map (x => x * 2 -> x * 2))
- Console.println("test2: "+sum(s map (._2)))
- }
- time {
- var x = 0
- for (val i <- (0 to 10000))
- s get i match {
- case Some(i) => x = x + i
- case None =>
- }
- Console.println("test3: "+x)
- }
- }
-
- def test(msg: String, s0: collection.mutable.Map[Int, Int]) = {
- Console.println("***** "+msg+":")
- var s = s0
- s = s + (2 -> 2)
- s = s + (3 -> 3, 4000 -> 4000, 10000 -> 10000)
- Console.println("test1: "+sum(s map (._2)))
- time {
- s = s ++ (List.range(0, 5000) map (x => x * 2 -> x * 2))
- Console.println("test2: "+sum(s map (._2)))
- }
- time {
- var x = 0
- for (val i <- (0 to 10000))
- s get i match {
- case Some(i) => x = x + i
- case None =>
- }
- Console.println("test3: "+x)
- }
- }
-
- test("immutable.ListSet", new immutable.ListSet[Int])
- test("immutable.TreeSet", new immutable.TreeSet[Int])
- test("mutable.HashSet", new mutable.HashSet[Int])
- test("immutable.ListMap", new immutable.ListMap[Int, Int])
- test("immutable.TreeMap", new immutable.TreeMap[Int, Int])
- test("immutable.UnBalancedTreeMap", new immutable.UnbalancedTreeMap[Int, Int])
- test("immutable.HashTreeSet", new immutable.HashTreeSet[Int])
- test("immutable.HashTreeMap", new immutable.HashTreeMap[Int, Int])
- test("mutable.HashMap", new mutable.HashMap[Int, Int])
-}