diff options
author | Felix Mulder <felix.mulder@gmail.com> | 2016-08-19 15:28:39 +0200 |
---|---|---|
committer | Felix Mulder <felix.mulder@gmail.com> | 2016-08-21 15:51:57 +0200 |
commit | 0b69be68d3100103ebfd636bbc36f9cdcbd6fb28 (patch) | |
tree | 2b7a1db4beda3963cdddfd4ce86d9d8d9108f5a0 /dottydoc/test/BaseTest.scala | |
parent | d8c02ec2f8ef225fde2be5324bbf46958132d865 (diff) | |
download | dotty-0b69be68d3100103ebfd636bbc36f9cdcbd6fb28.tar.gz dotty-0b69be68d3100103ebfd636bbc36f9cdcbd6fb28.tar.bz2 dotty-0b69be68d3100103ebfd636bbc36f9cdcbd6fb28.zip |
Add phase to deal with constructors
Diffstat (limited to 'dottydoc/test/BaseTest.scala')
-rw-r--r-- | dottydoc/test/BaseTest.scala | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/dottydoc/test/BaseTest.scala b/dottydoc/test/BaseTest.scala index 7f077d27b..2233d03c8 100644 --- a/dottydoc/test/BaseTest.scala +++ b/dottydoc/test/BaseTest.scala @@ -7,6 +7,7 @@ import dotc.util.SourceFile import dotc.core.Phases.Phase import dotc.typer.FrontEnd import dottydoc.core.DocASTPhase +import model.Package trait DottyTest { dotty.tools.dotc.parsing.Scanners // initialize keywords @@ -21,34 +22,33 @@ trait DottyTest { ctx } - private def compilerWithChecker(assertion: DocASTPhase => Unit) = new DocCompiler { - private[this] val docPhase = new DocASTPhase - - override def phases = - List(new FrontEnd) :: - List(docPhase) :: + private def compilerWithChecker(assertion: Map[String, Package] => Unit) = new DocCompiler { + private[this] val assertionPhase: List[List[Phase]] = List(new Phase { def phaseName = "assertionPhase" - override def run(implicit ctx: Context): Unit = assertion(docPhase) - }) :: - Nil + override def run(implicit ctx: Context): Unit = + assertion(ctx.docbase.packages[Package].toMap) + }) :: Nil + + override def phases = + super.phases ++ assertionPhase } - def checkSource(source: String)(assertion: DocASTPhase => Unit): Unit = { + def checkSource(source: String)(assertion: Map[String, Package] => Unit): Unit = { val c = compilerWithChecker(assertion) c.rootContext(ctx) val run = c.newRun run.compile(source) } - def checkFiles(sources: List[String])(assertion: DocASTPhase => Unit): Unit = { + def checkFiles(sources: List[String])(assertion: Map[String, Package] => Unit): Unit = { val c = compilerWithChecker(assertion) c.rootContext(ctx) val run = c.newRun run.compile(sources) } - def checkSources(sourceFiles: List[SourceFile])(assertion: DocASTPhase => Unit): Unit = { + def checkSources(sourceFiles: List[SourceFile])(assertion: Map[String, Package] => Unit): Unit = { val c = compilerWithChecker(assertion) c.rootContext(ctx) val run = c.newRun |