From 855a48702972e4c685a268ae07327a686df8e803 Mon Sep 17 00:00:00 2001 From: Tomasz Godzik Date: Fri, 31 Oct 2025 13:42:52 +0100 Subject: [PATCH] chore: Fix tests on windows full --- .../tools/scripting/BashExitCodeTests.scala | 2 +- ...ernalLocationProviderIntegrationTest.scala | 48 ++++++++++--------- 2 files changed, 26 insertions(+), 24 deletions(-) diff --git a/compiler/test/dotty/tools/scripting/BashExitCodeTests.scala b/compiler/test/dotty/tools/scripting/BashExitCodeTests.scala index 3aad9ef8813f..772744c8aba9 100644 --- a/compiler/test/dotty/tools/scripting/BashExitCodeTests.scala +++ b/compiler/test/dotty/tools/scripting/BashExitCodeTests.scala @@ -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 } diff --git a/scaladoc/test/dotty/tools/scaladoc/ExternalLocationProviderIntegrationTest.scala b/scaladoc/test/dotty/tools/scaladoc/ExternalLocationProviderIntegrationTest.scala index a63f699c4c2f..71b432d0dddd 100644 --- a/scaladoc/test/dotty/tools/scaladoc/ExternalLocationProviderIntegrationTest.scala +++ b/scaladoc/test/dotty/tools/scaladoc/ExternalLocationProviderIntegrationTest.scala @@ -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", @@ -73,7 +74,6 @@ class Scaladoc2LegacyExternalLocationProviderIntegrationTest extends LegacyExter ) ) - abstract class ExternalLocationProviderIntegrationTest( name: String, mappings: Seq[String], @@ -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,