Skip to content

Commit

Permalink
Merge pull request scala#12988 from philwalk/fix-scripts-tests
Browse files Browse the repository at this point in the history
  • Loading branch information
dwijnand authored Jul 5, 2021
2 parents 9fc286b + 078d1cb commit 270bd8b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
Empty file modified compiler/test-resources/scripting/showArgs.sc
100644 → 100755
Empty file.
10 changes: 6 additions & 4 deletions compiler/test/dotty/tools/scripting/BashScriptsTests.scala
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,12 @@ class BashScriptsTests:

val showArgsScript = testFiles.find(_.getName == "showArgs.sc").get.absPath

val scalacPath = which("scalac")
val scalaPath = which("scala")
val scalacPath = "dist/target/pack/bin/scalac" // which("scalac")
val scalaPath = "dist/target/pack/bin/scala" // which("scala")

/* verify `dist/bin/scalac` */
@Test def verifyScalacArgs =
printf("scalacPath[%s]\n",scalacPath)
val commandline = (Seq(scalacPath, "-script", showArgsScript) ++ testScriptArgs).mkString(" ")
if bashPath.toFile.exists then
var cmd = Array(bashExe, "-c", commandline)
Expand All @@ -50,7 +51,7 @@ class BashScriptsTests:
var fail = false
printf("\n")
for (line, expect) <- output zip expectedOutput do
printf("expected: %-17s| actual: %s\n", line, expect)
printf("expected: %-17s\nactual : %s\n", expect, line)
if line != expect then
fail = true

Expand All @@ -67,8 +68,9 @@ class BashScriptsTests:
} yield line
var fail = false
printf("\n")
var mismatches = List.empty[(String,String)]
for (line, expect) <- output zip expectedOutput do
printf("expected: %-17s| actual: %s\n", line, expect)
printf("expected: %-17s\nactual : %s\n", expect, line)
if line != expect then
fail = true

Expand Down

0 comments on commit 270bd8b

Please sign in to comment.