Skip to content

Fix scripts tests #12988

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Jul 5, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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