aboutsummaryrefslogtreecommitdiff
path: root/dottydoc
diff options
context:
space:
mode:
authorFelix Mulder <felix.mulder@gmail.com>2016-08-15 18:30:48 +0200
committerFelix Mulder <felix.mulder@gmail.com>2016-08-19 15:37:34 +0200
commit0a9003d7b018ad179b0a6b8630e1bdb99be06627 (patch)
tree9d9f79fda2ce68cf8fd6fef6d29cd453b68fd777 /dottydoc
parentabf16325cb8909b8c856d2a83ad7c9b05f49130b (diff)
downloaddotty-0a9003d7b018ad179b0a6b8630e1bdb99be06627.tar.gz
dotty-0a9003d7b018ad179b0a6b8630e1bdb99be06627.tar.bz2
dotty-0a9003d7b018ad179b0a6b8630e1bdb99be06627.zip
Move client test to client repo
Diffstat (limited to 'dottydoc')
-rw-r--r--dottydoc/test/WhitelistedStdLib.scala17
-rw-r--r--dottydoc/test/WhitelistedStdLibMain.scala46
2 files changed, 15 insertions, 48 deletions
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)
- }
-}