@@ -748,17 +748,17 @@ abstract class CompileTestDefinitions
748
748
|""" .stripMargin
749
749
)
750
750
inputs.fromRoot { root =>
751
- val result = os.proc(TestUtil .cli, " compile" , " ." ).call(
751
+ val result = os.proc(TestUtil .cli, " compile" , " ." , extraOptions ).call(
752
752
cwd = root,
753
753
check = false ,
754
754
mergeErrIntoOut = true
755
755
)
756
756
757
757
assertEquals(
758
758
TestUtil .fullStableOutput(result),
759
- s """ |Compiling project (Scala ${ Constants .scala3Next} , JVM ( ${Constants
759
+ s """ |Compiling project (Scala $actualScalaVersion , JVM ( ${Constants
760
760
.defaultGraalVMJavaVersion}))
761
- |Compiled project (Scala ${ Constants .scala3Next} , JVM ( ${Constants
761
+ |Compiled project (Scala $actualScalaVersion , JVM ( ${Constants
762
762
.defaultGraalVMJavaVersion})) """ .stripMargin
763
763
)
764
764
@@ -770,22 +770,29 @@ abstract class CompileTestDefinitions
770
770
|""" .stripMargin
771
771
)
772
772
773
- val result2 = os.proc(TestUtil .cli, " compile" , " ." ).call(
773
+ val result2 = os.proc(TestUtil .cli, " compile" , " ." , extraOptions ).call(
774
774
cwd = root,
775
775
check = false ,
776
776
mergeErrIntoOut = true
777
777
)
778
778
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
+
779
787
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
782
790
.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
786
793
|[error] val msg: String = 1
787
794
|[error] ^
788
- |Error compiling project (Scala ${ Constants .scala3Next} , JVM ( ${Constants
795
+ |Error compiling project (Scala $actualScalaVersion , JVM ( ${Constants
789
796
.defaultGraalVMJavaVersion}))
790
797
|Compilation failed """ .stripMargin
791
798
)
@@ -798,17 +805,17 @@ abstract class CompileTestDefinitions
798
805
|""" .stripMargin
799
806
)
800
807
801
- val result3 = os.proc(TestUtil .cli, " compile" , " ." ).call(
808
+ val result3 = os.proc(TestUtil .cli, " compile" , " ." , extraOptions ).call(
802
809
cwd = root,
803
810
check = false ,
804
811
mergeErrIntoOut = true
805
812
)
806
813
807
814
assertEquals(
808
815
TestUtil .fullStableOutput(result3),
809
- s """ |Compiling project (Scala ${ Constants .scala3Next} , JVM ( ${Constants
816
+ s """ |Compiling project (Scala $actualScalaVersion , JVM ( ${Constants
810
817
.defaultGraalVMJavaVersion}))
811
- |Compiled project (Scala ${ Constants .scala3Next} , JVM ( ${Constants
818
+ |Compiled project (Scala $actualScalaVersion , JVM ( ${Constants
812
819
.defaultGraalVMJavaVersion})) """ .stripMargin
813
820
)
814
821
0 commit comments