From 43b445579feb1499d3f405c64a45666037255f7d Mon Sep 17 00:00:00 2001 From: Paul Phillips Date: Fri, 14 Aug 2009 23:00:25 +0000 Subject: Polished up some disabled tests and returned th... Polished up some disabled tests and returned them to files. --- test/disabled/run/forvaleq.check | 5 -- test/disabled/run/forvaleq.scala | 92 ----------------------------------- test/disabled/run/iq.check | 12 ----- test/disabled/run/iq.scala | 100 --------------------------------------- 4 files changed, 209 deletions(-) delete mode 100644 test/disabled/run/forvaleq.check delete mode 100644 test/disabled/run/forvaleq.scala delete mode 100644 test/disabled/run/iq.check delete mode 100644 test/disabled/run/iq.scala (limited to 'test/disabled/run') diff --git a/test/disabled/run/forvaleq.check b/test/disabled/run/forvaleq.check deleted file mode 100644 index ec57719cb4..0000000000 --- a/test/disabled/run/forvaleq.check +++ /dev/null @@ -1,5 +0,0 @@ -List(2, 6, 10, 14, 18, 20, 22, 24, 26, 28, 30, 32, 34, 36, 38) -List(2, 6, 10, 14, 18, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2) -List(2, 6, 10, 14, 18, 20, 22, 24, 26, 28, 30, 32, 34, 36, 38) -List(2, 6, 10, 14, 18, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2) -called 20 times diff --git a/test/disabled/run/forvaleq.scala b/test/disabled/run/forvaleq.scala deleted file mode 100644 index 80d41acd85..0000000000 --- a/test/disabled/run/forvaleq.scala +++ /dev/null @@ -1,92 +0,0 @@ -// test "foo = expr" clauses in for comprehensions -// $Id$ - -import scala.collection.immutable.Queue -import scala.{List=>L} - -object Test { - // redefine some symbols to make it extra hard - class List - class Tuple2 - def List[A](as: A*) = 5 - - def firstDigit(x: Int): Int = - x match { - case 0 => 0 - case _ if (x<0) => firstDigit(-x) - case _ if (x<10) => x - case _ => firstDigit(x / 10) - } - - - { - // a basic test case - - val input = L.range(0,20) - val oddFirstTimesTwo = - for {x <- input - xf = firstDigit(x) - if xf % 2 == 1} - yield x*2 - println(oddFirstTimesTwo) - } - - { - // a test case with patterns - - val input = L.range(0, 20) - val oddFirstTimesTwo = - for {x <- input - xf = firstDigit(x) - yf = x - firstDigit(x) / 10 - (a, b) = (xf - yf, xf + yf) - if xf % 2 == 1} - yield a + b - println(oddFirstTimesTwo) - } - - { - // make sure it works on non-Ls - - // val input: Queue = Queue.Empty[int].incl(L.range(0,20)) - val input = L.range(0, 20).iterator - val oddFirstTimesTwo = - for {x <- input - xf = firstDigit(x) - if xf % 2 == 1} - yield x*2 - println(oddFirstTimesTwo.toList) - } - - { - // yield the computed value - - val input = L.range(0,20) - val oddFirstTimesTwo = - for {x <- input - xf = firstDigit(x) - if xf % 2 == 1} - yield xf*2 - println(oddFirstTimesTwo) - } - - { - // make sure the function is only called once - var count: Int = 0 - - def fdct(x: Int) = { - count += 1 - firstDigit(x) - } - - val input = L.range(0,20) - for {x <- input - xf = fdct(x) - if xf % 2 == 1} - yield xf - - println("called " + count + " times") - } - - def main(args: Array[String]) {} -} diff --git a/test/disabled/run/iq.check b/test/disabled/run/iq.check deleted file mode 100644 index 81114ea181..0000000000 --- a/test/disabled/run/iq.check +++ /dev/null @@ -1,12 +0,0 @@ -Empty -Head: 42 -q5: Queue(0, 1, 2, 3, 4, 5, 6, 7, 8, 9) -q5[5]: 5 -q5 == q5c: true -q5c == q5: true -q8: Queue(2, 3, 4, 5, 6, 7, 8, 9, 10, 11) -q8 == q9: true -Elements: 1 2 3 4 5 6 7 8 9 -String: <1-2-3-4-5-6-7-8-9> -Length: 9 -Front: 1 diff --git a/test/disabled/run/iq.scala b/test/disabled/run/iq.scala deleted file mode 100644 index b07da22fe6..0000000000 --- a/test/disabled/run/iq.scala +++ /dev/null @@ -1,100 +0,0 @@ -/* $Id$ - * Test file for immutable queues. - */ - -import scala.collection.immutable.Queue - -object iq { - def main { - /* Create an empty queue. */ - val q: Queue[Int] = Queue.Empty - - /* Test isEmpty. - * Expected: Empty - */ - if (q.isEmpty) { - Console.println("Empty") - } - - /* Test infix enqueing. */ - //val q2 = q + 42 + 0 // deprecated - val q2 = q.enqueue(42).enqueue(0) - - /* Test is empty and dequeue. - * Expected: Head: 42 - */ - val q4 = - if (q2.isEmpty) { - Console.println("Empty") - q2 - } - else { - val (head, q3) = q2.dequeue - Console.println("Head: " + head) - q3 - } - - /* Test sequence enqueing. */ - val q5: Queue[Any] = q4.enqueue(List(1,2,3,4,5,6,7,8,9)) - /* Test toString. - * Expected: Head: q5: Queue(0,1,2,3,4,5,6,7,8,9) - */ - Console.println("q5: " + q5) - /* Test apply - * Expected: q5[5]: 5 - */ - Console.println("q5[5]: " + q5(5)) - - val q5c: Queue[Int] = Queue.Empty.enqueue(List(0, 1, 2, 3, 4, 5, 6, 7, 8, 9)) - - /* Testing == - * Expected: q5 == q9: true - * q9 == q5: true - */ - Console.println("q5 == q5c: " + (q5 == q5c)) - Console.println("q5c == q5: " + (q5c == q5)) - - val (_, q6) = q5.dequeue - val (_, q7) = q6.dequeue - //val q8 = q7 + 10 + 11 //deprecated - val q8 = q7.enqueue(10).enqueue(11) - /* Test dequeu - * Expected: q8: Queue(2,3,4,5,6,7,8,9,10,11) - */ - Console.println("q8: " + q8) - val q9 = new Queue(2,3,4,5,6,7,8,9,10,11) - - /* Testing == - * Expected: q8 == q9: true - */ - Console.println("q8 == q9: " + (q8 == q9)) - - /* Testing elements - * Expected: Elements: 1 2 3 4 5 6 7 8 9 - */ - Console.print("Elements: "); - q6.iterator.foreach(e => Console.print(" "+ e + " ")) - Console.println; - - /* Testing mkString - * Expected: String: <1-2-3-4-5-6-7-8-9> - */ - Console.println("String: " + q6.mkString("<","-",">")) - - /* Testing length - * Expected: Length: 9 - */ - Console.println("Length: " + q6.length) - - /* Testing front - * Expected: Front: 1 - */ - Console.println("Front: " + q6.front); - } -} - -object Test { - def main(args: Array[String]) { - iq.main - } -} -- cgit v1.2.3