diff options
author | Paul Phillips <paulp@improving.org> | 2012-04-14 05:03:26 +0100 |
---|---|---|
committer | Paul Phillips <paulp@improving.org> | 2012-04-14 05:03:26 +0100 |
commit | 3a2901da406f2478b5634b0636e56de9c4cd676d (patch) | |
tree | 352ad9227f4616b0abf9b6fca76a123da8a42bd8 /test/disabled/run/implicits-scopes.scala | |
parent | 7bd3b62ea5fc425fcf24685b6b8d8c5d1da0b8f5 (diff) | |
parent | e638405d4c89c22f9fd72bc63806c7ff57c30e41 (diff) | |
download | scala-3a2901da406f2478b5634b0636e56de9c4cd676d.tar.gz scala-3a2901da406f2478b5634b0636e56de9c4cd676d.tar.bz2 scala-3a2901da406f2478b5634b0636e56de9c4cd676d.zip |
Merge commit 'refs/pull/395/head'
Diffstat (limited to 'test/disabled/run/implicits-scopes.scala')
-rw-r--r-- | test/disabled/run/implicits-scopes.scala | 77 |
1 files changed, 77 insertions, 0 deletions
diff --git a/test/disabled/run/implicits-scopes.scala b/test/disabled/run/implicits-scopes.scala new file mode 100644 index 0000000000..7b9e80e148 --- /dev/null +++ b/test/disabled/run/implicits-scopes.scala @@ -0,0 +1,77 @@ +import scala.tools.nsc.doc.model._ +import scala.tools.partest.ScaladocModelTest +import language._ + +object Test extends ScaladocModelTest { + + // test a file instead of a piece of code + override def resourceFile = "implicits-scopes-res.scala" + + // start implicits + def scaladocSettings = "-implicits" + + def testModel(root: Package) = { + // get the quick access implicit defs in scope (_package(s), _class(es), _trait(s), object(s) _method(s), _value(s)) + import access._ + var conv: ImplicitConversion = null + + // SEE THE test/resources/implicits-chaining-res.scala FOR THE EXPLANATION OF WHAT'S CHECKED HERE: + val base = root._package("scala")._package("test")._package("scaladoc")._package("implicits")._package("scopes") + +//// test1 ///////////////////////////////////////////////////////////////////////////////////////////////////////////// + + val doTest1 = { + val test1 = base._package("test1") + val A = test1._class("A") + + conv = A._conversion(test1.qualifiedName + ".package.toB") // the .package means it's the package object + assert(conv.members.length == 1) + assert(conv.constraints.length == 0) + } + +//// test2 ///////////////////////////////////////////////////////////////////////////////////////////////////////////// + + val doTest2 = { + val test2 = base._package("test2") + val classes = test2._package("classes") + val A = classes._class("A") + + assert(A._conversions(test2.qualifiedName + ".toB").isEmpty) + } + +//// test3 ///////////////////////////////////////////////////////////////////////////////////////////////////////////// + + val doTest3 = { + val test3 = base._package("test3") + val A = test3._class("A") + + conv = A._conversion(A.qualifiedName + ".toB") + assert(conv.members.length == 1) + assert(conv.constraints.length == 0) + } + +//// test4 ///////////////////////////////////////////////////////////////////////////////////////////////////////////// + + val doTest4 = { + val test4 = base._package("test4") + val A = test4._class("A") + val S = test4._object("S") + + conv = A._conversion(S.qualifiedName + ".toB") + assert(conv.members.length == 1) + assert(conv.constraints.length == 0) + } + +//// test5 ///////////////////////////////////////////////////////////////////////////////////////////////////////////// + + val doTest5 = { + val test5 = base._package("test5") + val scope = test5._object("scope") + val A = scope._class("A") + + conv = A._conversion(scope.qualifiedName + ".toB") + assert(conv.members.length == 1) + assert(conv.constraints.length == 0) + } + } +} |