diff options
author | Vlad Ureche <vlad.ureche@gmail.com> | 2012-03-27 10:35:40 +0200 |
---|---|---|
committer | Vlad Ureche <vlad.ureche@gmail.com> | 2012-03-27 10:35:40 +0200 |
commit | 5632167f6cacec16d82b1961d233d7e761cf6036 (patch) | |
tree | 13cf3cdd1b8e41ddaa7c0a22d805dbbc6cfa7bb7 /test | |
parent | a532ba0600444b3564b6b015688ebc4cdf084ba6 (diff) | |
download | scala-5632167f6cacec16d82b1961d233d7e761cf6036.tar.gz scala-5632167f6cacec16d82b1961d233d7e761cf6036.tar.bz2 scala-5632167f6cacec16d82b1961d233d7e761cf6036.zip |
Fixes SI-5373
And adds basic support for scaladoc model tests (class
partest.ScaladocModelTest)
Diffstat (limited to 'test')
-rw-r--r-- | test/scaladoc/run/SI-5373.check | 1 | ||||
-rw-r--r-- | test/scaladoc/run/SI-5373.scala | 34 | ||||
-rw-r--r-- | test/scaladoc/scala/html.flags | 1 | ||||
-rw-r--r-- | test/scaladoc/scalacheck/CommentFactoryTest.scala (renamed from test/scaladoc/scala/model/CommentFactoryTest.scala) | 0 | ||||
-rw-r--r-- | test/scaladoc/scalacheck/HtmlFactoryTest.flags (renamed from test/scaladoc/scala/html/HtmlFactoryTest.flags) | 0 | ||||
-rw-r--r-- | test/scaladoc/scalacheck/HtmlFactoryTest.scala (renamed from test/scaladoc/scala/html/HtmlFactoryTest.scala) | 4 | ||||
-rw-r--r-- | test/scaladoc/scalacheck/IndexScriptTest.scala (renamed from test/scaladoc/scala/IndexScriptTest.scala) | 2 | ||||
-rw-r--r-- | test/scaladoc/scalacheck/IndexTest.scala (renamed from test/scaladoc/scala/IndexTest.scala) | 2 |
8 files changed, 39 insertions, 5 deletions
diff --git a/test/scaladoc/run/SI-5373.check b/test/scaladoc/run/SI-5373.check new file mode 100644 index 0000000000..c55eb001cf --- /dev/null +++ b/test/scaladoc/run/SI-5373.check @@ -0,0 +1 @@ +model contains 6 documentable templates diff --git a/test/scaladoc/run/SI-5373.scala b/test/scaladoc/run/SI-5373.scala new file mode 100644 index 0000000000..af433a1844 --- /dev/null +++ b/test/scaladoc/run/SI-5373.scala @@ -0,0 +1,34 @@ +import scala.tools.nsc.doc.model._ +import scala.tools.partest.ScaladocModelTest + +object Test extends ScaladocModelTest { + + def code = """ + import scala.annotation.bridge + + package scala.test { + + trait A { + def foo = () + } + + trait B { + @bridge() + def foo = () + } + + class C extends A with B + } + """ + + // no need for special settings + def scaladocSettings = "" + + def testModel(rootPackage: Package) = { + // get the quick access implicit defs in scope (_package(s), _class(es), _trait(s), object(s) _method(s), _value(s)) + import access._ + + // just need to check the member exists, access methods will throw an error if there's a problem + rootPackage._package("scala")._package("test")._class("C")._method("foo") + } +}
\ No newline at end of file diff --git a/test/scaladoc/scala/html.flags b/test/scaladoc/scala/html.flags deleted file mode 100644 index b2264ec4f4..0000000000 --- a/test/scaladoc/scala/html.flags +++ /dev/null @@ -1 +0,0 @@ --encoding UTF-8
\ No newline at end of file diff --git a/test/scaladoc/scala/model/CommentFactoryTest.scala b/test/scaladoc/scalacheck/CommentFactoryTest.scala index 69c314a64c..69c314a64c 100644 --- a/test/scaladoc/scala/model/CommentFactoryTest.scala +++ b/test/scaladoc/scalacheck/CommentFactoryTest.scala diff --git a/test/scaladoc/scala/html/HtmlFactoryTest.flags b/test/scaladoc/scalacheck/HtmlFactoryTest.flags index b2264ec4f4..b2264ec4f4 100644 --- a/test/scaladoc/scala/html/HtmlFactoryTest.flags +++ b/test/scaladoc/scalacheck/HtmlFactoryTest.flags diff --git a/test/scaladoc/scala/html/HtmlFactoryTest.scala b/test/scaladoc/scalacheck/HtmlFactoryTest.scala index 28c7a4b94f..5b6f75426e 100644 --- a/test/scaladoc/scala/html/HtmlFactoryTest.scala +++ b/test/scaladoc/scalacheck/HtmlFactoryTest.scala @@ -50,7 +50,7 @@ object Test extends Properties("HtmlFactory") { def createTemplates(basename: String) = { val result = scala.collection.mutable.Map[String, scala.xml.NodeSeq]() - createFactory.makeUniverse(List(RESOURCES+basename)) match { + createFactory.makeUniverse(Left(List(RESOURCES+basename))) match { case Some(universe) => { val index = IndexModelFactory.makeIndex(universe) (new HtmlFactory(universe, index)).writeTemplates((page) => { @@ -64,7 +64,7 @@ object Test extends Properties("HtmlFactory") { } def createReferenceIndex(basename: String) = { - createFactory.makeUniverse(List(RESOURCES+basename)) match { + createFactory.makeUniverse(Left(List(RESOURCES+basename))) match { case Some(universe) => { val index = IndexModelFactory.makeIndex(universe) val pages = index.firstLetterIndex.map({ diff --git a/test/scaladoc/scala/IndexScriptTest.scala b/test/scaladoc/scalacheck/IndexScriptTest.scala index e0372020fd..5aef38e00a 100644 --- a/test/scaladoc/scala/IndexScriptTest.scala +++ b/test/scaladoc/scalacheck/IndexScriptTest.scala @@ -24,7 +24,7 @@ object Test extends Properties("IndexScript") { val indexModelFactory = doc.model.IndexModelFactory def createIndexScript(path: String) = - docFactory.makeUniverse(List(path)) match { + docFactory.makeUniverse(Left(List(path))) match { case Some(universe) => { val index = new IndexScript(universe, indexModelFactory.makeIndex(universe)) diff --git a/test/scaladoc/scala/IndexTest.scala b/test/scaladoc/scalacheck/IndexTest.scala index c14fd98297..29e337da2b 100644 --- a/test/scaladoc/scala/IndexTest.scala +++ b/test/scaladoc/scalacheck/IndexTest.scala @@ -37,7 +37,7 @@ object Test extends Properties("Index") { //val original = Console.out //Console.setOut(stream) - val result = docFactory.makeUniverse(List(path)) + val result = docFactory.makeUniverse(Left(List(path))) // assert(stream.toString == "model contains 2 documentable templates\n") //Console.setOut(original) |