diff options
author | Adriaan Moors <adriaan@lightbend.com> | 2016-06-23 15:21:47 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-06-23 15:21:47 -0700 |
commit | 4e950838cbee187f3cee2ef197164792db74e56a (patch) | |
tree | 1c84b98ede763daa8bfe81c4bf55dfd38b3d3343 /test | |
parent | 79e7334f93da4717ee846f74e48ab53533e6756d (diff) | |
parent | 2d85fe47fddd3759db37e0106920688dcbceb7ef (diff) | |
download | scala-4e950838cbee187f3cee2ef197164792db74e56a.tar.gz scala-4e950838cbee187f3cee2ef197164792db74e56a.tar.bz2 scala-4e950838cbee187f3cee2ef197164792db74e56a.zip |
Merge pull request #5242 from szeiger/wip/merge-2.11-to-2.12-june-19
Merge 2.11 to 2.12 [ci: last-only]
Diffstat (limited to 'test')
-rw-r--r-- | test/files/pos/t9245.scala | 27 | ||||
-rw-r--r-- | test/osgi/src/logback.xml | 10 | ||||
-rw-r--r-- | test/scaladoc/.gitignore | 2 | ||||
-rw-r--r-- | test/scaladoc/run/SI-191.scala | 12 | ||||
-rw-r--r-- | test/scaladoc/run/t8557.scala | 20 |
5 files changed, 64 insertions, 7 deletions
diff --git a/test/files/pos/t9245.scala b/test/files/pos/t9245.scala new file mode 100644 index 0000000000..87bc1fa0ef --- /dev/null +++ b/test/files/pos/t9245.scala @@ -0,0 +1,27 @@ + +/* +Was: +test/files/pos/t9245.scala:5: error: recursive value catchExpr1 needs type + try {} catch catchExpr1 + ^ + +Now: + def catchExpr1: PartialFunction[Throwable,Any] = scala.this.Predef.???; + def test: Any = try { + () + } catch { + case (x$1 @ (_: Throwable)) => { + <artifact> val catchExpr$1: PartialFunction[Throwable,Any] = Test.this.catchExpr1; + if (catchExpr$1.isDefinedAt(x$1)) + catchExpr$1.apply(x$1) + else + throw x$1 + } + } +*/ +trait Test { + def catchExpr1: PartialFunction[Throwable, Any] = ??? + def test = { + try {} catch catchExpr1 + } +} diff --git a/test/osgi/src/logback.xml b/test/osgi/src/logback.xml new file mode 100644 index 0000000000..692ccbfdd9 --- /dev/null +++ b/test/osgi/src/logback.xml @@ -0,0 +1,10 @@ +<configuration> + <appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender"> + <encoder> + <pattern>*** \(%logger{30}\)%green(%X{debugId}) %msg%n</pattern> + </encoder> + </appender> + <root level="${log.root:-warn}"> + <appender-ref ref="STDOUT" /> + </root> +</configuration> diff --git a/test/scaladoc/.gitignore b/test/scaladoc/.gitignore new file mode 100644 index 0000000000..161be5b55f --- /dev/null +++ b/test/scaladoc/.gitignore @@ -0,0 +1,2 @@ +*.log +*.obj/ diff --git a/test/scaladoc/run/SI-191.scala b/test/scaladoc/run/SI-191.scala index 29b1e7dd29..f3d269ceb0 100644 --- a/test/scaladoc/run/SI-191.scala +++ b/test/scaladoc/run/SI-191.scala @@ -33,10 +33,14 @@ object Test extends ScaladocModelTest { def scalaURL = "http://bog.us" override def scaladocSettings = { - val scalaLibUri = getClass.getClassLoader.getResource("scala/Function1.class").getPath.split("!")(0) - val scalaLibPath = new URI(scalaLibUri).getPath - val externalArg = s"$scalaLibPath#$scalaURL" - "-no-link-warnings -doc-external-doc " + externalArg + val samplePath = getClass.getClassLoader.getResource("scala/Function1.class").getPath + val scalaLibPath = if(samplePath.contains("!")) { // in scala-library.jar + val scalaLibUri = samplePath.split("!")(0) + new URI(scalaLibUri).getPath + } else { // individual class files on disk + samplePath.replace('\\', '/').dropRight("scala/Function1.class".length) + } + s"-no-link-warnings -doc-external-doc $scalaLibPath#$scalaURL" } def testModel(rootPackage: Package) { diff --git a/test/scaladoc/run/t8557.scala b/test/scaladoc/run/t8557.scala index 451f004d7d..7876896bb7 100644 --- a/test/scaladoc/run/t8557.scala +++ b/test/scaladoc/run/t8557.scala @@ -1,3 +1,5 @@ +import java.net.URI + import scala.tools.nsc.doc.base._ import scala.tools.nsc.doc.model._ import scala.tools.partest.ScaladocModelTest @@ -15,10 +17,22 @@ object Test extends ScaladocModelTest { class A """ + def scalaURL = "http://www.scala-lang.org/api/current/" + // a non-canonical path to scala-library.jar should still work - // this is a bit fragile (depends on the current directory being the root of the repo ; - // ant & partest seem to do that properly) - def scaladocSettings = "-doc-external-doc build/pack/bin/../lib/scala-library.jar#http://www.scala-lang.org/api/current/" + override def scaladocSettings = { + val samplePath = getClass.getClassLoader.getResource("scala/Function1.class").getPath.replace('\\', '/') + val scalaLibPath = if(samplePath.contains("!")) { // in scala-library.jar + val scalaLibUri = samplePath.split("!")(0) + val p = new URI(scalaLibUri).getPath + // this is a bit fragile (depends on the scala library being in build/pack as produced by ant) + p.replace("/pack/lib/scala-library.jar", "/pack/bin/../lib/scala-library.jar") + } else { // individual class files on disk + val p = samplePath.dropRight("scala/Function1.class".length + 1) + p + "/.." + p.takeRight(p.length - p.lastIndexOf('/')) + } + s"-doc-external-doc $scalaLibPath#$scalaURL" + } def testModel(rootPackage: Package) = { // get the quick access implicit defs in scope (_package(s), _class(es), _trait(s), object(s) _method(s), _value(s)) |