Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ class BashExitCodeTests:
@Test def vPhases = scala("-Vphases")(0)

@Test def replEval =
scala("--repl-quit-after-init", "--repl-init-script", "'val i = 2 * 2; val j = i + 2'")(0)
scala("--repl-quit-after-init", "--repl-init-script", "\"val i = 2 * 2; val j = i + 2\"")(0)

/** A utility for running two commands in a row, like you do in bash. */
extension (inline u1: Unit) inline def & (inline u2: Unit): Unit = { u1; u2 }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import dotty.tools.scaladoc.test.BuildInfo
import java.nio.file.Path;
import org.jsoup.Jsoup
import util.IO
import scala.util.Properties

class JavadocExternalLocationProviderIntegrationTest extends ExternalLocationProviderIntegrationTest(
"externalJavadoc",
Expand Down Expand Up @@ -73,7 +74,6 @@ class Scaladoc2LegacyExternalLocationProviderIntegrationTest extends LegacyExter
)
)


abstract class ExternalLocationProviderIntegrationTest(
name: String,
mappings: Seq[String],
Expand All @@ -87,31 +87,33 @@ abstract class ExternalLocationProviderIntegrationTest(
).toList
)

override def runTest = afterRendering {
val output = summon[DocContext].args.output.toPath
val linksBuilder = List.newBuilder[String]
override def runTest = if(!Properties.isWin) {
afterRendering {
val output = summon[DocContext].args.output.toPath
val linksBuilder = List.newBuilder[String]

def processFile(path: Path): Unit =
val document = Jsoup.parse(IO.read(path))
val content = document.select(".documentableElement").forEach { elem =>
val hrefValues = elem.select("a").asScala.map { a =>
a.attr("href")
def processFile(path: Path): Unit =
val document = Jsoup.parse(IO.read(path))
val content = document.select(".documentableElement").forEach { elem =>
val hrefValues = elem.select("a").asScala.map { a =>
a.attr("href")
}
linksBuilder ++= hrefValues
}
linksBuilder ++= hrefValues
}

IO.foreachFileIn(output, processFile)
val links = linksBuilder.result
val errors = expectedLinks.flatMap(expect => Option.when(!links.contains(expect))(expect))
if !errors.isEmpty then {
val reportMessage =
"External location provider integration test failed.\n" +
"Missing links:\n"
+ errors.mkString("\n","\n","\n")
+ "Found links:" + links.mkString("\n","\n","\n")
reportError(reportMessage)
}
} :: Nil
IO.foreachFileIn(output, processFile)
val links = linksBuilder.result
val errors = expectedLinks.flatMap(expect => Option.when(!links.contains(expect))(expect))
if !errors.isEmpty then {
val reportMessage =
"External location provider integration test failed.\n" +
"Missing links:\n"
+ errors.mkString("\n","\n","\n")
+ "Found links:" + links.mkString("\n","\n","\n")
reportError(reportMessage)
}
} :: Nil
}

abstract class LegacyExternalLocationProviderIntegrationTest(
name: String,
Expand Down
Loading