Skip to content

Commit bd9fe44

Browse files
committed
chore: Try fix windows issues
1 parent d7e7583 commit bd9fe44

File tree

3 files changed

+24
-17
lines changed

3 files changed

+24
-17
lines changed

modules/integration/src/test/scala/scala/cli/integration/CompileTestDefinitions.scala

Lines changed: 20 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -748,17 +748,17 @@ abstract class CompileTestDefinitions
748748
|""".stripMargin
749749
)
750750
inputs.fromRoot { root =>
751-
val result = os.proc(TestUtil.cli, "compile", ".").call(
751+
val result = os.proc(TestUtil.cli, "compile", ".", extraOptions).call(
752752
cwd = root,
753753
check = false,
754754
mergeErrIntoOut = true
755755
)
756756

757757
assertEquals(
758758
TestUtil.fullStableOutput(result),
759-
s"""|Compiling project (Scala ${Constants.scala3Next}, JVM (${Constants
759+
s"""|Compiling project (Scala $actualScalaVersion, JVM (${Constants
760760
.defaultGraalVMJavaVersion}))
761-
|Compiled project (Scala ${Constants.scala3Next}, JVM (${Constants
761+
|Compiled project (Scala $actualScalaVersion, JVM (${Constants
762762
.defaultGraalVMJavaVersion}))""".stripMargin
763763
)
764764

@@ -770,22 +770,29 @@ abstract class CompileTestDefinitions
770770
|""".stripMargin
771771
)
772772

773-
val result2 = os.proc(TestUtil.cli, "compile", ".").call(
773+
val result2 = os.proc(TestUtil.cli, "compile", ".", extraOptions).call(
774774
cwd = root,
775775
check = false,
776776
mergeErrIntoOut = true
777777
)
778778

779+
val expectedError = if (actualScalaVersion.startsWith("2"))
780+
"""|[error] type mismatch;
781+
|[error] found : Int(1)
782+
|[error] required: String""".stripMargin
783+
else
784+
"""|[error] Found: (1 : Int)
785+
|[error] Required: String""".stripMargin
786+
779787
assertEquals(
780-
TestUtil.fullStableOutput(result2),
781-
s"""|Compiling project (Scala ${Constants.scala3Next}, JVM (${Constants
788+
TestUtil.fullStableOutput(result2).trim,
789+
s"""|Compiling project (Scala $actualScalaVersion, JVM (${Constants
782790
.defaultGraalVMJavaVersion}))
783-
|[error] ./Main.scala:2:23
784-
|[error] Found: (1 : Int)
785-
|[error] Required: String
791+
|[error] .${File.separatorChar}Main.scala:2:23
792+
|$expectedError
786793
|[error] val msg: String = 1
787794
|[error] ^
788-
|Error compiling project (Scala ${Constants.scala3Next}, JVM (${Constants
795+
|Error compiling project (Scala $actualScalaVersion, JVM (${Constants
789796
.defaultGraalVMJavaVersion}))
790797
|Compilation failed""".stripMargin
791798
)
@@ -798,17 +805,17 @@ abstract class CompileTestDefinitions
798805
|""".stripMargin
799806
)
800807

801-
val result3 = os.proc(TestUtil.cli, "compile", ".").call(
808+
val result3 = os.proc(TestUtil.cli, "compile", ".", extraOptions).call(
802809
cwd = root,
803810
check = false,
804811
mergeErrIntoOut = true
805812
)
806813

807814
assertEquals(
808815
TestUtil.fullStableOutput(result3),
809-
s"""|Compiling project (Scala ${Constants.scala3Next}, JVM (${Constants
816+
s"""|Compiling project (Scala $actualScalaVersion, JVM (${Constants
810817
.defaultGraalVMJavaVersion}))
811-
|Compiled project (Scala ${Constants.scala3Next}, JVM (${Constants
818+
|Compiled project (Scala $actualScalaVersion, JVM (${Constants
812819
.defaultGraalVMJavaVersion}))""".stripMargin
813820
)
814821

modules/integration/src/test/scala/scala/cli/integration/CompileTests213.scala

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
package scala.cli.integration
22

33
import scala.util.Properties
4-
import scala.cli.integration.Constants.defaultGraalVMJavaVersion
54

65
class CompileTests213 extends CompileTestDefinitions with Test213 {
76

modules/integration/src/test/scala/scala/cli/integration/TestUtil.scala

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -115,11 +115,12 @@ object TestUtil {
115115
def removeAnsiColors(str: String) = str.replaceAll("\\e\\[[0-9]+m", "")
116116

117117
def fullStableOutput(result: os.CommandResult) =
118-
TestUtil.removeAnsiColors(result.toString).trim().linesIterator.filterNot { str =>
118+
removeAnsiColors(result.toString).trim().linesIterator.filterNot { str =>
119119
// these lines are not stable and can easily change
120-
val shouldNotContain = Set("Starting compilation server", "hint", "Download", "Result of")
120+
val shouldNotContain =
121+
Set("Starting compilation server", "hint", "Download", "Result of", "Checking", "Checked")
121122
shouldNotContain.exists(str.contains)
122-
}.mkString("\n")
123+
}.mkString(System.lineSeparator())
123124

124125
def retry[T](
125126
maxAttempts: Int = 3,

0 commit comments

Comments
 (0)