~ubuntu-branches/debian/sid/scala/sid

« back to all changes in this revision

Viewing changes to test/scaladoc/run/SI-5784.scala

  • Committer: Package Import Robot
  • Author(s): Emmanuel Bourg, Mehdi Dogguy, Lucas Satabin, Frank S. Thomas, Emmanuel Bourg
  • Date: 2015-06-05 23:52:59 UTC
  • mfrom: (1.2.11)
  • Revision ID: package-import@ubuntu.com-20150605235259-wk00vgk83dh8o19g
Tags: 2.10.5-1
* Team upload.

[ Mehdi Dogguy ]
* New upstream release (Closes: #744278).

[ Lucas Satabin ]
* Update patches
* Update the clean target
* Update paths of elements to install
* Update watch file

[ Frank S. Thomas ]
* Remove myself from Uploaders.

[ Emmanuel Bourg ]
* The package has been adopted by the Java Team (Closes: #754935)
* Patched the build to avoid downloading libraries from the Internet
* Replaced the minified JavaScript files with unobfuscated ones
* No longer build scala-partest.jar until diffutils is packaged or replaced
* debian/watch: Fixed the versions matched (x.y.z instead of x.y.z..z)
* debian/rules:
  - Added the missing get-orig-source target (Closes: #724704)
  - Improved the clean target
* debian/control:
  - Build depend on scala (>= 2.10) and bnd
  - Use canonical URLs for the Vcs-* fields
  - Standards-Version updated to 3.9.6 (no changes)
* Switch to debhelper level 9

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
import scala.tools.nsc.doc.model._
 
2
import scala.tools.partest.ScaladocModelTest
 
3
 
 
4
object Test extends ScaladocModelTest {
 
5
 
 
6
  override def resourceFile: String = "SI-5784.scala"
 
7
 
 
8
  // no need for special settings
 
9
  def scaladocSettings = "-diagrams"
 
10
 
 
11
  def testModel(rootPackage: Package) = {
 
12
    // get the quick access implicit defs in scope (_package(s), _class(es), _trait(s), object(s) _method(s), _value(s))
 
13
    import access._
 
14
 
 
15
    val main = rootPackage._package("test")._package("templates")
 
16
 
 
17
    val String = main._aliasTypeTpl("String")
 
18
    assert(String.companion.isDefined, "test.templates.String should have a pseudo-companion object")
 
19
 
 
20
    val Base = main._trait("Base")
 
21
    assert(Base.members.filter(_.inDefinitionTemplates.head == Base).length == 5, Base.members.filter(_.inDefinitionTemplates.head == Base).length + " == 5")
 
22
    assert(Base.members.collect{case d: DocTemplateEntity => d}.length == 4, Base.members.collect{case d: DocTemplateEntity => d}.length == 4)
 
23
    testDiagram(Base, Base.contentDiagram, 2, 1)
 
24
 
 
25
    val BaseT = Base._absTypeTpl("T")
 
26
    val Foo = Base._trait("Foo")
 
27
    assert(BaseT.members.filter(_.inDefinitionTemplates.head == Base).length == 0, BaseT.members.filter(_.inDefinitionTemplates.head == Base).length + " == 0")
 
28
    assert(BaseT.members.map(_.name).sorted == Foo.members.map(_.name).sorted, BaseT.members.map(_.name).sorted + " == " + Foo.members.map(_.name).sorted)
 
29
    assert(BaseT.companion.isDefined, "test.templates.Base.T should have a pseudo-companion object")
 
30
    testDiagram(BaseT, BaseT.inheritanceDiagram, 2, 1)
 
31
 
 
32
    val Api = main._trait("Api")
 
33
    assert(Api.members.filter(_.inDefinitionTemplates.head == Api).length == 2, Api.members.filter(_.inDefinitionTemplates.head == Api).length + " == 2") // FooApi and override type T
 
34
    assert(Api.members.collect{case d: DocTemplateEntity => d}.length == 5, Api.members.collect{case d: DocTemplateEntity => d}.length == 5)
 
35
    testDiagram(Api, Api.contentDiagram, 3, 2)
 
36
 
 
37
    val ApiT = Api._absTypeTpl("T")
 
38
    val FooApi = Api._trait("FooApi")
 
39
    assert(ApiT.members.filter(_.inDefinitionTemplates.head == Api).length == 0, ApiT.members.filter(_.inDefinitionTemplates.head == Api).length + " == 0")
 
40
    assert(ApiT.members.map(_.name).sorted == FooApi.members.map(_.name).sorted, ApiT.members.map(_.name).sorted + " == " + FooApi.members.map(_.name).sorted)
 
41
    assert(ApiT.companion.isDefined, "test.templates.Api.T should have a pseudo-companion object")
 
42
    testDiagram(ApiT, ApiT.inheritanceDiagram, 2, 1)
 
43
  }
 
44
}
 
 
b'\\ No newline at end of file'