diff options
Diffstat (limited to 'scalalib/test/resources/hello-world-no-main')
5 files changed, 33 insertions, 0 deletions
diff --git a/scalalib/test/resources/hello-world-no-main/core/src-2.10/Shim.scala b/scalalib/test/resources/hello-world-no-main/core/src-2.10/Shim.scala new file mode 100644 index 00000000..025cff5c --- /dev/null +++ b/scalalib/test/resources/hello-world-no-main/core/src-2.10/Shim.scala @@ -0,0 +1,5 @@ +object Shim{ + def main(args: Array[String]): Unit = { + Main0(args(0), scala.util.Properties.versionNumberString + " rox") + } +}
\ No newline at end of file diff --git a/scalalib/test/resources/hello-world-no-main/core/src-2.11/Shim.scala b/scalalib/test/resources/hello-world-no-main/core/src-2.11/Shim.scala new file mode 100644 index 00000000..d98a6de1 --- /dev/null +++ b/scalalib/test/resources/hello-world-no-main/core/src-2.11/Shim.scala @@ -0,0 +1,5 @@ +object Shim{ + def main(args: Array[String]): Unit = { + Main0(args(0), scala.util.Properties.versionNumberString + " pwns") + } +}
\ No newline at end of file diff --git a/scalalib/test/resources/hello-world-no-main/core/src-2.12/Shim.scala b/scalalib/test/resources/hello-world-no-main/core/src-2.12/Shim.scala new file mode 100644 index 00000000..1f3e1c0f --- /dev/null +++ b/scalalib/test/resources/hello-world-no-main/core/src-2.12/Shim.scala @@ -0,0 +1,5 @@ +object Shim{ + def main(args: Array[String]): Unit = { + Main0(args(0), scala.util.Properties.versionNumberString + " leet") + } +}
\ No newline at end of file diff --git a/scalalib/test/resources/hello-world-no-main/core/src/Main.scala b/scalalib/test/resources/hello-world-no-main/core/src/Main.scala new file mode 100644 index 00000000..5f68fd3f --- /dev/null +++ b/scalalib/test/resources/hello-world-no-main/core/src/Main.scala @@ -0,0 +1,11 @@ +import scala.collection._ +import java.nio.file.{Files, Paths} + +import Main.{args, greeting} +object Main0{ + def apply(s: String, greeting: String) = { + val resultPath = Paths.get(s) + Files.createDirectories(resultPath.getParent) + Files.write(resultPath, greeting.getBytes) + } +} diff --git a/scalalib/test/resources/hello-world-no-main/core/src/Result.scala b/scalalib/test/resources/hello-world-no-main/core/src/Result.scala new file mode 100644 index 00000000..d7d29a51 --- /dev/null +++ b/scalalib/test/resources/hello-world-no-main/core/src/Result.scala @@ -0,0 +1,7 @@ +object Person { + def fromString(s: String): Person = { + val Array(name, age) = s.split(":") + Person(name, age.toInt) + } +} +case class Person(name: String, age: Int) |