diff options
author | Hubert Plociniczak <hubert.plociniczak@epfl.ch> | 2011-11-02 14:34:35 +0000 |
---|---|---|
committer | Hubert Plociniczak <hubert.plociniczak@epfl.ch> | 2011-11-02 14:34:35 +0000 |
commit | b6778be91900b8161e705dc2598ef7af86842b0b (patch) | |
tree | d15e8ec18a37eec212f50f1ace27714d7e7d4d34 /test/disabled/run | |
parent | ac6c76f26d884a94d0c9ff54f055d3f9ab750bac (diff) | |
download | scala-b6778be91900b8161e705dc2598ef7af86842b0b.tar.gz scala-b6778be91900b8161e705dc2598ef7af86842b0b.tar.bz2 scala-b6778be91900b8161e705dc2598ef7af86842b0b.zip |
Begone t1737...
Diffstat (limited to 'test/disabled/run')
-rw-r--r-- | test/disabled/run/applet-prop.scala | 12 | ||||
-rw-r--r-- | test/disabled/run/coder2/Coder2.scala | 72 | ||||
-rw-r--r-- | test/disabled/run/javap.scala | 2 | ||||
-rw-r--r-- | test/disabled/run/lisp.scala | 4 | ||||
-rw-r--r-- | test/disabled/run/script-positions.scala | 20 | ||||
-rw-r--r-- | test/disabled/run/t4279.scala | 2 |
6 files changed, 56 insertions, 56 deletions
diff --git a/test/disabled/run/applet-prop.scala b/test/disabled/run/applet-prop.scala index fb112bf7d5..9c29dfd979 100644 --- a/test/disabled/run/applet-prop.scala +++ b/test/disabled/run/applet-prop.scala @@ -10,7 +10,7 @@ object Test extends SecurityTest { val s = new S // lazy val TestKey = sys.SystemProperties.noTraceSupression.key // def hitPerm() = new Throwable with scala.util.control.ControlThrowable { } - // + // // var throwing = false // override def propertyCheck(p: PropertyPermission): Unit = { // if (p.getName == TestKey) { @@ -19,21 +19,21 @@ object Test extends SecurityTest { // throwIt(p) // } // } - // + // // hitPerm() // securityOn() // hitPerm() - // + // // throwing = true // - // val caught = + // val caught = // try { hitPerm() ; false } // catch { case _: AccessControlException => true } - // + // // assert(caught, "Should have incurred exception.") // throwing = false // hitPerm() - // + // // val xs = new Traversable[Int] { def foreach[U](f: Int => U) = 1 to 3 foreach f } // xs foreach println } diff --git a/test/disabled/run/coder2/Coder2.scala b/test/disabled/run/coder2/Coder2.scala index abe284a398..43b2e9bcb8 100644 --- a/test/disabled/run/coder2/Coder2.scala +++ b/test/disabled/run/coder2/Coder2.scala @@ -5,31 +5,31 @@ import collection.parallel._//immutable._ class SeqCoder(words: List[String]) { - + private val m = Map( - '2' -> "ABC", '3' -> "DEF", '4' -> "GHI", '5' -> "JKL", + '2' -> "ABC", '3' -> "DEF", '4' -> "GHI", '5' -> "JKL", '6' -> "MNO", '7' -> "PQRS", '8' -> "TUV", '9' -> "WXYZ") - + /** Invert the mnemnonics map to give a map from chars 'A' ... 'Z' to '2' ... '9' */ - private val charCode: Map[Char, Char] = + private val charCode: Map[Char, Char] = for ((digit, letters) <- m; letter <- letters) yield letter -> digit - - /** Maps a word to the digit string it represents, + + /** Maps a word to the digit string it represents, * e.g. `Java` -> `5282` */ private def wordCode(word: String): String = word.toUpperCase map charCode - - /** A map from digit strings to the words that represent + + /** A map from digit strings to the words that represent * them e.g. `5282` -> List(`Java`, `Kata`, `Lava`, ...) */ - val wordsForNum: Map[String, Seq[String]] = + val wordsForNum: Map[String, Seq[String]] = (words groupBy wordCode).map(t => (t._1, t._2.toSeq)) withDefaultValue Seq() - + val memo = collection.mutable.Map[String, Set[Seq[String]]]("" -> Set(Seq())) val wfnmemo = collection.mutable.Map[(String, String), Set[Seq[String]]]() val subsmemo = collection.mutable.Map[(String, String, String), Set[Seq[String]]]() - + /** All ways to encode a number as a list of words */ - def encode(number: String): Set[Seq[String]] = + def encode(number: String): Set[Seq[String]] = if (number.isEmpty) Set(Seq()) else { val splits = (1 to number.length).toSet @@ -51,38 +51,38 @@ class SeqCoder(words: List[String]) { memo += number -> r r } - - /** Maps a number to a list of all word phrases that can + + /** Maps a number to a list of all word phrases that can * represent it */ def translate(number: String): Set[String] = encode(number) map (_ mkString " ") - + def ??? : Nothing = throw new UnsupportedOperationException } class ParCoder(words: List[String]) { - + private val m = Map( - '2' -> "ABC", '3' -> "DEF", '4' -> "GHI", '5' -> "JKL", + '2' -> "ABC", '3' -> "DEF", '4' -> "GHI", '5' -> "JKL", '6' -> "MNO", '7' -> "PQRS", '8' -> "TUV", '9' -> "WXYZ") - + /** Invert the mnemnonics map to give a map from chars 'A' ... 'Z' to '2' ... '9' */ - private val charCode: Map[Char, Char] = + private val charCode: Map[Char, Char] = for ((digit, letters) <- m; letter <- letters) yield letter -> digit - - /** Maps a word to the digit string it represents, + + /** Maps a word to the digit string it represents, * e.g. `Java` -> `5282` */ private def wordCode(word: String): String = word.toUpperCase map charCode - - /** A map from digit strings to the words that represent + + /** A map from digit strings to the words that represent * them e.g. `5282` -> List(`Java`, `Kata`, `Lava`, ...) */ - val wordsForNum: Map[String, ParSeq[String]] = + val wordsForNum: Map[String, ParSeq[String]] = (words groupBy wordCode).map(t => (t._1, t._2.toSeq.par)) withDefaultValue ParSeq() - + val comparison = new SeqCoder(words) - + /** All ways to encode a number as a list of words */ - def encode(number: String): ParSet[ParSeq[String]] = + def encode(number: String): ParSet[ParSeq[String]] = if (number.isEmpty) ParSet(ParSeq()) else { val splits = (1 to number.length).toSet.par @@ -105,7 +105,7 @@ class ParCoder(words: List[String]) { assertNumber(number, r) r } - + def assertSubs(num: String, subsfrom: String, word: String, r: ParSet[ParSeq[String]]) { val m = comparison.subsmemo((num, subsfrom, word)) if (r != m) { @@ -115,7 +115,7 @@ class ParCoder(words: List[String]) { error("r != m") } } - + def assertWfn(num: String, split: String, dropped: String, r: ParSeq[ParSeq[String]]) { val m = comparison.wfnmemo((num, split)) val rs = r.toSet.par @@ -139,7 +139,7 @@ class ParCoder(words: List[String]) { error("rs != m") } } - + def assertNumber(num: String, r: ParSet[ParSeq[String]]) { val m = comparison.memo(num) if (r != m) { @@ -149,14 +149,14 @@ class ParCoder(words: List[String]) { error("r != m") } } - - /** Maps a number to a list of all word phrases that can + + /** Maps a number to a list of all word phrases that can * represent it */ def translate(number: String): ParSet[String] = { comparison.translate(number) encode(number) map (_.seq mkString " ") } - + def ??? : Nothing = throw new UnsupportedOperationException } @@ -165,18 +165,18 @@ class ParCoder(words: List[String]) { object Test { val code = "2328437472947"//36262633"//837976"//"6477323986225453446" //val code = "747294736262633" - + /* */ def main(args : Array[String]) { for (i <- 0 until 10) { val seqcoder = new SeqCoder(Dictionary.wordlist) val sts = seqcoder.translate(code) //println("Translation check: " + st.size) - + val parcoder = new ParCoder(Dictionary.wordlist) val pts = parcoder.translate(code) //println("Translation check: " + pt.size) - + val st = sts.toList.sorted val pt = pts.toList.sorted if (st.size != pt.size) { diff --git a/test/disabled/run/javap.scala b/test/disabled/run/javap.scala index 241a83fa6f..3704d64423 100644 --- a/test/disabled/run/javap.scala +++ b/test/disabled/run/javap.scala @@ -14,7 +14,7 @@ object Test { (line startsWith "private") || (line startsWith "public") } foreach println } - + def main(args: Array[String]): Unit = { run("") run("-v") diff --git a/test/disabled/run/lisp.scala b/test/disabled/run/lisp.scala index f3687ea1bb..06e68f508a 100644 --- a/test/disabled/run/lisp.scala +++ b/test/disabled/run/lisp.scala @@ -12,11 +12,11 @@ class LispTokenizer(s: String) extends Iterator[String] { while (i < s.length() && s.charAt(i) <= ' ') i += 1 i < s.length() } - def next: String = + def next: String = if (hasNext) { val start = i if (isDelimiter(s charAt i)) i += 1 - else + else do i = i + 1 while (!isDelimiter(s charAt i)) s.substring(start, i) diff --git a/test/disabled/run/script-positions.scala b/test/disabled/run/script-positions.scala index 6982ed8440..2c80d550c0 100644 --- a/test/disabled/run/script-positions.scala +++ b/test/disabled/run/script-positions.scala @@ -4,9 +4,9 @@ import util.stringFromStream // Testing "scripts" without the platform delights which accompany actual scripts. object Scripts { - val test1 = -"""#!/bin/sh - exec scala $0 $@ + val test1 = +"""#!/bin/sh + exec scala $0 $@ !# println("statement 1") @@ -29,7 +29,7 @@ val x = "line 6" val y = "line 7" val z "line 8"""" - val output2 = + val output2 = """bob.scala:8: error: '=' expected but string literal found. val z "line 8" ^ @@ -41,10 +41,10 @@ two errors found""" object Test { import Scripts._ - + def settings = new GenericRunnerSettings(println _) settings.nocompdaemon.value = true - + def runScript(code: String): String = stringFromStream(stream => Console.withOut(stream) { @@ -53,7 +53,7 @@ object Test { } } ) - + val tests: List[(String, String)] = List( test1 -> output1, test2 -> output2 @@ -67,14 +67,14 @@ object Test { case idx => s drop (idx + 7) } def toLines(text: String) = lines(text) map stripFilename - + def main(args: Array[String]): Unit = { - for ((code, expected) <- tests) { + for ((code, expected) <- tests) { val out = toLines(runScript(code)) val exp = toLines(expected) val nomatch = out zip exp filter { case (x, y) => x != y } val success = out.size == exp.size && nomatch.isEmpty - + assert( success, "Output doesn't match expected:\n" + diff --git a/test/disabled/run/t4279.scala b/test/disabled/run/t4279.scala index d0afc3a032..62cc436302 100644 --- a/test/disabled/run/t4279.scala +++ b/test/disabled/run/t4279.scala @@ -5,7 +5,7 @@ import scala.tools.partest._ class Runner(num: Int, reps: Int) extends TestUtil { var dummy = 0 val range = Array.range(0, num) - + def iteratorSlice = { def it = range.iterator.slice(num - 2, num) for (i <- 1 to reps) |