diff options
author | Paul Phillips <paulp@improving.org> | 2013-02-01 17:38:56 -0800 |
---|---|---|
committer | Paul Phillips <paulp@improving.org> | 2013-02-01 17:38:56 -0800 |
commit | a45a78a1d4111709acdc0bca9a1ac869a8e53ea5 (patch) | |
tree | 5c909c41db2470c460cbb3c33672294c9342b914 /test/files/run | |
parent | 26de4394b19d6614b7d414b33f66ebf7adcb8833 (diff) | |
parent | 644eb7078a11613a06dcaaefb807cbcc44f65ea7 (diff) | |
download | scala-a45a78a1d4111709acdc0bca9a1ac869a8e53ea5.tar.gz scala-a45a78a1d4111709acdc0bca9a1ac869a8e53ea5.tar.bz2 scala-a45a78a1d4111709acdc0bca9a1ac869a8e53ea5.zip |
Merge commit '644eb7078a' into wip/fresh-merge2
Conflicts:
build.xml
src/compiler/scala/tools/nsc/backend/jvm/GenJVM.scala
Diffstat (limited to 'test/files/run')
-rw-r--r-- | test/files/run/reify-staticXXX.scala | 36 | ||||
-rw-r--r-- | test/files/run/t4574.scala | 13 | ||||
-rw-r--r-- | test/files/run/t6669.scala | 26 | ||||
-rw-r--r-- | test/files/run/t6968.check | 1 | ||||
-rw-r--r-- | test/files/run/t6968.scala | 7 |
5 files changed, 52 insertions, 31 deletions
diff --git a/test/files/run/reify-staticXXX.scala b/test/files/run/reify-staticXXX.scala index dc861f843e..e80157dd8f 100644 --- a/test/files/run/reify-staticXXX.scala +++ b/test/files/run/reify-staticXXX.scala @@ -4,12 +4,12 @@ import scala.tools.reflect.Eval object B { override def toString = "object" } class C { override def toString = "class" } -package foo { +package foo1 { object B { override def toString = "package > object" } class C { override def toString = "package > class" } } -object foo { +object Foo2 { object B { override def toString = "object > object" } class C { override def toString = "object > class" } } @@ -20,14 +20,14 @@ object packageless { println(reify(B).eval) println(new C) println(reify(new C).eval) - println(foo.B) - println(reify(foo.B).eval) - println(new foo.C) - println(reify(new foo.C).eval) - println(_root_.foo.B) - println(reify(_root_.foo.B).eval) - println(new _root_.foo.C) - println(reify(new _root_.foo.C).eval) + println(Foo2.B) + println(reify(Foo2.B).eval) + println(new Foo2.C) + println(reify(new Foo2.C).eval) + println(_root_.foo1.B) + println(reify(_root_.foo1.B).eval) + println(new _root_.foo1.C) + println(reify(new _root_.foo1.C).eval) } } @@ -38,14 +38,14 @@ package packageful { println(reify(B).eval) println(new C) println(reify(new C).eval) - println(foo.B) - println(reify(foo.B).eval) - println(new foo.C) - println(reify(new foo.C).eval) - println(_root_.foo.B) - println(reify(_root_.foo.B).eval) - println(new _root_.foo.C) - println(reify(new _root_.foo.C).eval) + println(Foo2.B) + println(reify(Foo2.B).eval) + println(new Foo2.C) + println(reify(new Foo2.C).eval) + println(_root_.foo1.B) + println(reify(_root_.foo1.B).eval) + println(new _root_.foo1.C) + println(reify(new _root_.foo1.C).eval) } } } diff --git a/test/files/run/t4574.scala b/test/files/run/t4574.scala deleted file mode 100644 index 1dde496aca..0000000000 --- a/test/files/run/t4574.scala +++ /dev/null @@ -1,13 +0,0 @@ -object Test { - val xs: List[(Int, Int)] = List((2, 2), null) - - def expectMatchError[T](msg: String)(body: => T) { - try { body ; assert(false, "Should not succeed.") } - catch { case _: MatchError => println(msg) } - } - - def main(args: Array[String]): Unit = { - expectMatchError("I hereby refute null!")( for ((x, y) <- xs) yield x ) - expectMatchError("I denounce null as unListLike!")( (null: Any) match { case List(_*) => true } ) - } -} diff --git a/test/files/run/t6669.scala b/test/files/run/t6669.scala new file mode 100644 index 0000000000..b55718b12b --- /dev/null +++ b/test/files/run/t6669.scala @@ -0,0 +1,26 @@ +import java.io.{ByteArrayOutputStream, PrintStream} + +object Test extends App { + val baos = new ByteArrayOutputStream() + val ps = new PrintStream(baos) + + // first test with the default classpath + (scala.Console withOut ps) { + scala.tools.scalap.Main.main(Array("-verbose", "java.lang.Object")) + } + + // now make sure we saw the '.' in the classpath + val msg1 = baos.toString() + assert(msg1 contains "directory classpath: .", s"Did not see '.' in the default class path. Full results were:\n$msg1") + + // then test again with a user specified classpath + baos.reset + + (scala.Console withOut ps) { + scala.tools.scalap.Main.main(Array("-verbose", "-cp", "whatever", "java.lang.Object")) + } + + // now make sure we did not see the '.' in the classpath + val msg2 = baos.toString() + assert(!(msg2 contains "directory classpath: ."), s"Did saw '.' in the user specified class path. Full results were:\n$msg2") +} diff --git a/test/files/run/t6968.check b/test/files/run/t6968.check new file mode 100644 index 0000000000..7a18941537 --- /dev/null +++ b/test/files/run/t6968.check @@ -0,0 +1 @@ +1, 3, 5 diff --git a/test/files/run/t6968.scala b/test/files/run/t6968.scala new file mode 100644 index 0000000000..b5cadfd9e1 --- /dev/null +++ b/test/files/run/t6968.scala @@ -0,0 +1,7 @@ +object Test { + def main(args: Array[String]) { + val mixedList = List(1,(1,2),4,(3,1),(5,4),6) + val as = for((a,b) <- mixedList) yield a + println(as.mkString(", ")) + } +} |