Skip to content

Commit 839f825

Browse files
bishaboshahamzaremmal
authored andcommitted
adjust test sources to be clear which are meant to be self-executing
1 parent e541f42 commit 839f825

22 files changed

+50
-55
lines changed

compiler/test-resources/scripting/argfileClasspath.sc

Lines changed: 0 additions & 9 deletions
This file was deleted.

compiler/test-resources/scripting/classpathReport.sc renamed to compiler/test-resources/scripting/classpathReport_scalacli.sc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#!/usr/bin/env bin/scala
2-
2+
// This file is a Scala CLI script.
33
import java.nio.file.Paths
44

55
// def main(args: Array[String]): Unit = // MIGRATION: Scala CLI expects `*.sc` files to be straight-line code

compiler/test-resources/scripting/cpArgumentsFile.txt

Lines changed: 0 additions & 1 deletion
This file was deleted.
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,4 @@
1+
// this file is intended to be ran as an argument to the dotty.tools.scripting.ScriptingDriver class
2+
13
def main(args: Array[String]): Unit =
24
println("Hello " + util.Properties.propOrNull("key"))

compiler/test-resources/scripting/envtestNu.sc

Lines changed: 0 additions & 2 deletions
This file was deleted.
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
// This file is a Scala CLI script.
2+
3+
println("Hello " + util.Properties.propOrNull("key"))

compiler/test-resources/scripting/hashBang.sc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#!/usr/bin/env scala
1+
#!/usr/bin/env fake-program-to-test-hashbang-removal
22
# comment
33
STUFF=nada
44
!#

compiler/test-resources/scripting/hashBang.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
#!/usr/bin/env scala
1+
#!/usr/bin/env fake-program-to-test-hashbang-removal
22
# comment
33
STUFF=nada
44
!#
5-
5+
// everything above this point should be ignored by the compiler
66
def main(args: Array[String]): Unit =
77
System.err.printf("mainClassFromStack: %s\n",mainFromStack)
88
assert(mainFromStack.contains("hashBang"),s"fromStack[$mainFromStack]")

compiler/test-resources/scripting/scriptName.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#!/usr/bin/env scala
1+
// this file is intended to be ran as an argument to the dotty.tools.scripting.ScriptingDriver class
22

33
def main(args: Array[String]): Unit =
44
val name = Option(sys.props("script.name")) match {

compiler/test-resources/scripting/scriptPath.sc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#!dist/target/pack/bin/scala
1+
// this file is intended to be ran as an argument to the dotty.tools.scripting.ScriptingDriver class
22

33
def main(args: Array[String]): Unit =
44
args.zipWithIndex.foreach { case (arg,i) => printf("arg %d: [%s]\n",i,arg) }

0 commit comments

Comments
 (0)