From 0a9003d7b018ad179b0a6b8630e1bdb99be06627 Mon Sep 17 00:00:00 2001 From: Felix Mulder Date: Mon, 15 Aug 2016 18:30:48 +0200 Subject: Move client test to client repo --- dottydoc/test/WhitelistedStdLib.scala | 17 ++++++++++-- dottydoc/test/WhitelistedStdLibMain.scala | 46 ------------------------------- 2 files changed, 15 insertions(+), 48 deletions(-) delete mode 100644 dottydoc/test/WhitelistedStdLibMain.scala (limited to 'dottydoc') diff --git a/dottydoc/test/WhitelistedStdLib.scala b/dottydoc/test/WhitelistedStdLib.scala index 88dc67e99..0225ba218 100644 --- a/dottydoc/test/WhitelistedStdLib.scala +++ b/dottydoc/test/WhitelistedStdLib.scala @@ -5,8 +5,21 @@ import org.junit.Test import org.junit.Assert._ class TestWhitelistedCollections extends DottyTest { + val files: List[String] = { + val whitelist = "./test/dotc/scala-collections.whitelist" + + scala.io.Source.fromFile(whitelist, "UTF8") + .getLines() + .map(_.trim) // allow identation + .filter(!_.startsWith("#")) // allow comment lines prefixed by # + .map(_.takeWhile(_ != '#').trim) // allow comments in the end of line + .filter(_.nonEmpty) + .filterNot(_.endsWith("package.scala")) + .toList + } + @Test def arrayHasDocumentation = - checkFiles(WhitelistedStandardLib.files) { doc => + checkFiles(files) { doc => val array = doc .packages("scala") .children.find(_.path.mkString(".") == "scala.Array") @@ -16,7 +29,7 @@ class TestWhitelistedCollections extends DottyTest { } @Test def traitImmutableHasDocumentation = - checkFiles(WhitelistedStandardLib.files) { doc => + checkFiles(files) { doc => val imm = doc .packages("scala") .children.find(_.path.mkString(".") == "scala.Immutable") diff --git a/dottydoc/test/WhitelistedStdLibMain.scala b/dottydoc/test/WhitelistedStdLibMain.scala deleted file mode 100644 index fcd08e50d..000000000 --- a/dottydoc/test/WhitelistedStdLibMain.scala +++ /dev/null @@ -1,46 +0,0 @@ -package dotty.tools -package dottydoc - -import scala.io.Source - -object WhitelistedStandardLib extends dottydoc.api.scala.Dottydoc { - import scala.collection.JavaConverters._ - - val files: List[String] = { - val whitelist = "./test/dotc/scala-collections.whitelist" - - Source.fromFile(whitelist, "UTF8") - .getLines() - .map(_.trim) // allow identation - .filter(!_.startsWith("#")) // allow comment lines prefixed by # - .map(_.takeWhile(_ != '#').trim) // allow comments in the end of line - .filter(_.nonEmpty) - .filterNot(_.endsWith("package.scala")) - .toList - } - - private val resources = List( - "../dottydoc-client/resources/MaterialIcons-Regular.eot", - "../dottydoc-client/resources/MaterialIcons-Regular.ijmap", - "../dottydoc-client/resources/MaterialIcons-Regular.svg", - "../dottydoc-client/resources/MaterialIcons-Regular.ttf", - "../dottydoc-client/resources/MaterialIcons-Regular.woff", - "../dottydoc-client/resources/MaterialIcons-Regular.woff2", - "../dottydoc-client/resources/codepoints", - "../dottydoc-client/resources/github.css", - "../dottydoc-client/resources/highlight.pack.js", - "../dottydoc-client/resources/index.css", - "../dottydoc-client/resources/material-icons.css", - "../dottydoc-client/resources/material.min.css", - "../dottydoc-client/resources/material.min.js", - "../dottydoc-client/target/scala-2.11/dottydoc-client-fastopt.js" - ) - - override def main(args: Array[String]) = { - val compilerArgs = - "-language:Scala2" +: "-Ydoc-output" +: "../build/dottydoc" +: files.toArray - - val index = createIndex(compilerArgs) - buildDocs("../build/dottydoc", "../../dottydoc-client/resources/template.html", resources, index) - } -} -- cgit v1.2.3