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

« back to all changes in this revision

Viewing changes to test/scaladoc/run/implicits-scopes.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
import language._
 
4
 
 
5
object Test extends ScaladocModelTest {
 
6
 
 
7
  // test a file instead of a piece of code
 
8
  override def resourceFile = "implicits-scopes-res.scala"
 
9
 
 
10
  // start implicits
 
11
  def scaladocSettings = "-implicits"
 
12
 
 
13
  def testModel(root: Package) = {
 
14
    // get the quick access implicit defs in scope (_package(s), _class(es), _trait(s), object(s) _method(s), _value(s))
 
15
    import access._
 
16
    var conv: ImplicitConversion = null
 
17
 
 
18
    // SEE THE test/resources/implicits-chaining-res.scala FOR THE EXPLANATION OF WHAT'S CHECKED HERE:
 
19
    val base = root._package("scala")._package("test")._package("scaladoc")._package("implicits")._package("scopes")
 
20
 
 
21
//// test1 /////////////////////////////////////////////////////////////////////////////////////////////////////////////
 
22
 
 
23
    val doTest1 = {
 
24
      val test1 = base._package("test1")
 
25
      val A = test1._class("A")
 
26
 
 
27
      conv = A._conversion(test1.qualifiedName + ".toB")
 
28
      assert(conv.members.length == 1)
 
29
      assert(conv.constraints.length == 0)
 
30
    }
 
31
 
 
32
//// test2 /////////////////////////////////////////////////////////////////////////////////////////////////////////////
 
33
 
 
34
    val doTest2 = {
 
35
      val test2 = base._package("test2")
 
36
      val classes = test2._package("classes")
 
37
      val A = classes._class("A")
 
38
 
 
39
      conv = A._conversion(test2.qualifiedName + ".toB")
 
40
      assert(conv.members.length == 1)
 
41
      assert(conv.constraints.length == 0)
 
42
    }
 
43
 
 
44
//// test3 /////////////////////////////////////////////////////////////////////////////////////////////////////////////
 
45
 
 
46
    val doTest3 = {
 
47
      val test3 = base._package("test3")
 
48
      val A = test3._class("A")
 
49
 
 
50
      conv = A._conversion(A.qualifiedName + ".toB")
 
51
      assert(conv.members.length == 1)
 
52
      assert(conv.constraints.length == 0)
 
53
    }
 
54
 
 
55
//// test4 /////////////////////////////////////////////////////////////////////////////////////////////////////////////
 
56
 
 
57
    val doTest4 = {
 
58
      val test4 = base._package("test4")
 
59
      val A = test4._class("A")
 
60
      val S = test4._object("S")
 
61
 
 
62
      conv = A._conversion(S.qualifiedName + ".toB")
 
63
      assert(conv.members.length == 1)
 
64
      assert(conv.constraints.length == 0)
 
65
    }
 
66
 
 
67
//// test5 /////////////////////////////////////////////////////////////////////////////////////////////////////////////
 
68
 
 
69
    val doTest5 = {
 
70
      val test5 = base._package("test5")
 
71
      val scope = test5._object("scope")
 
72
      val A = scope._class("A")
 
73
 
 
74
      conv = A._conversion(scope.qualifiedName + ".toB")
 
75
      assert(conv.members.length == 1)
 
76
      assert(conv.constraints.length == 0)
 
77
    }
 
78
  }
 
79
}