Skip to content

Commit 92d1387

Browse files
authored
Merge pull request #605 from tgodzik/fix-windows-tests
chore: Fix tests on windows full
2 parents 0985bd2 + 855a487 commit 92d1387

File tree

2 files changed

+26
-24
lines changed

2 files changed

+26
-24
lines changed

compiler/test/dotty/tools/scripting/BashExitCodeTests.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ class BashExitCodeTests:
6363
@Test def vPhases = scala("-Vphases")(0)
6464

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

6868
/** A utility for running two commands in a row, like you do in bash. */
6969
extension (inline u1: Unit) inline def & (inline u2: Unit): Unit = { u1; u2 }

scaladoc/test/dotty/tools/scaladoc/ExternalLocationProviderIntegrationTest.scala

Lines changed: 25 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import dotty.tools.scaladoc.test.BuildInfo
77
import java.nio.file.Path;
88
import org.jsoup.Jsoup
99
import util.IO
10+
import scala.util.Properties
1011

1112
class JavadocExternalLocationProviderIntegrationTest extends ExternalLocationProviderIntegrationTest(
1213
"externalJavadoc",
@@ -73,7 +74,6 @@ class Scaladoc2LegacyExternalLocationProviderIntegrationTest extends LegacyExter
7374
)
7475
)
7576

76-
7777
abstract class ExternalLocationProviderIntegrationTest(
7878
name: String,
7979
mappings: Seq[String],
@@ -87,31 +87,33 @@ abstract class ExternalLocationProviderIntegrationTest(
8787
).toList
8888
)
8989

90-
override def runTest = afterRendering {
91-
val output = summon[DocContext].args.output.toPath
92-
val linksBuilder = List.newBuilder[String]
90+
override def runTest = if(!Properties.isWin) {
91+
afterRendering {
92+
val output = summon[DocContext].args.output.toPath
93+
val linksBuilder = List.newBuilder[String]
9394

94-
def processFile(path: Path): Unit =
95-
val document = Jsoup.parse(IO.read(path))
96-
val content = document.select(".documentableElement").forEach { elem =>
97-
val hrefValues = elem.select("a").asScala.map { a =>
98-
a.attr("href")
95+
def processFile(path: Path): Unit =
96+
val document = Jsoup.parse(IO.read(path))
97+
val content = document.select(".documentableElement").forEach { elem =>
98+
val hrefValues = elem.select("a").asScala.map { a =>
99+
a.attr("href")
100+
}
101+
linksBuilder ++= hrefValues
99102
}
100-
linksBuilder ++= hrefValues
101-
}
102103

103-
IO.foreachFileIn(output, processFile)
104-
val links = linksBuilder.result
105-
val errors = expectedLinks.flatMap(expect => Option.when(!links.contains(expect))(expect))
106-
if !errors.isEmpty then {
107-
val reportMessage =
108-
"External location provider integration test failed.\n" +
109-
"Missing links:\n"
110-
+ errors.mkString("\n","\n","\n")
111-
+ "Found links:" + links.mkString("\n","\n","\n")
112-
reportError(reportMessage)
113-
}
114-
} :: Nil
104+
IO.foreachFileIn(output, processFile)
105+
val links = linksBuilder.result
106+
val errors = expectedLinks.flatMap(expect => Option.when(!links.contains(expect))(expect))
107+
if !errors.isEmpty then {
108+
val reportMessage =
109+
"External location provider integration test failed.\n" +
110+
"Missing links:\n"
111+
+ errors.mkString("\n","\n","\n")
112+
+ "Found links:" + links.mkString("\n","\n","\n")
113+
reportError(reportMessage)
114+
}
115+
} :: Nil
116+
}
115117

116118
abstract class LegacyExternalLocationProviderIntegrationTest(
117119
name: String,

0 commit comments

Comments
 (0)