Skip to content

Commit

Permalink
Adjust BuiltInTests for Scala 3.5.1+
Browse files Browse the repository at this point in the history
  • Loading branch information
Gedochao committed Sep 20, 2024
1 parent ee89c05 commit 2cd0689
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions amm/repl/src/test/scala/ammonite/DualTestRepl.scala
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ class DualTestRepl { dual =>
else scalaVersion.takeWhile(_ != '.')
def scala2 = scalaVersion.startsWith("2.")
def scala2_12 = scalaVersion.startsWith("2.12.")
def scala3_5_1OrHigher = scalaVersion.startsWith("3.5.1") || scalaVersion.split(".")(1).toInt >= 6

def interps = repls.map(_.interp)

Expand Down
2 changes: 2 additions & 0 deletions amm/repl/src/test/scala/ammonite/session/BuiltinTests.scala
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,8 @@ object BuiltinTests extends TestSuite {
} else {
val configCompiler = if (check.scala2)
"""@ interp.configureCompiler(_.settings.language.tryToSet(List("dynamics")))"""
else if (check.scala3_5_1OrHigher)
"""@ interp.preConfigureCompiler(ctx => ctx.setSetting(ctx.settings.language, ctx.settings.language.choices.toList.flatten.asInstanceOf[List[dotty.tools.dotc.config.Settings.Setting.ChoiceWithHelp[String]]].filter(_.name == "dynamics")))"""
else
"""@ interp.preConfigureCompiler(ctx => ctx.setSetting(ctx.settings.language, List("dynamics")))"""
check.session(s"""
Expand Down

0 comments on commit 2cd0689

Please sign in to comment.