@@ -13,7 +13,7 @@ abstract class ReplTestDefinitions extends ScalaCliSuite with TestScalaVersionAr
13
13
" scala.util.Properties.versionNumberString"
14
14
else " dotty.tools.dotc.config.Properties.simpleVersionString"
15
15
16
- def expectedAmmoniteVersion : String =
16
+ def expectedScalaVersionForAmmonite : String =
17
17
actualScalaVersion match {
18
18
case s
19
19
if s.startsWith(" 2.12" ) &&
@@ -62,7 +62,10 @@ abstract class ReplTestDefinitions extends ScalaCliSuite with TestScalaVersionAr
62
62
os.proc(TestUtil .cli, " --power" , " repl" , testExtraOptions, " --ammonite" , ammArgs)
63
63
.call(cwd = root, stderr = os.Pipe )
64
64
val output = res.out.trim()
65
- expect(output == s " Hello from Scala $expectedAmmoniteVersion" )
65
+ val expectedSv =
66
+ if (useMaxAmmoniteScalaVersion) actualMaxAmmoniteScalaVersion
67
+ else expectedScalaVersionForAmmonite
68
+ expect(output == s " Hello from Scala $expectedSv" )
66
69
if (useMaxAmmoniteScalaVersion) {
67
70
// the maximum Scala version supported by ammonite is being used, so we shouldn't downgrade
68
71
val errOutput = res.err.trim()
@@ -122,8 +125,11 @@ abstract class ReplTestDefinitions extends ScalaCliSuite with TestScalaVersionAr
122
125
" --python" ,
123
126
ammArgs
124
127
).call(cwd = root, stderr = os.Pipe )
128
+ val expectedSv =
129
+ if (useMaxAmmoniteScalaVersion) actualMaxAmmoniteScalaVersion
130
+ else expectedScalaVersionForAmmonite
125
131
val lines = res.out.trim().linesIterator.toVector
126
- expect(lines == Seq (s " Hello from Scala $expectedAmmoniteVersion " , " Hello from ScalaPy" ))
132
+ expect(lines == Seq (s " Hello from Scala $expectedSv " , " Hello from ScalaPy" ))
127
133
if (useMaxAmmoniteScalaVersion)
128
134
// the maximum Scala version supported by ammonite is being used, so we shouldn't downgrade
129
135
expect(! res.err.trim().contains(" not yet supported with this version of Ammonite" ))
0 commit comments