diff options
Diffstat (limited to 'test/files')
-rw-r--r-- | test/files/run/bug4671.check | 46 | ||||
-rw-r--r-- | test/files/run/bug4671.scala | 13 |
2 files changed, 59 insertions, 0 deletions
diff --git a/test/files/run/bug4671.check b/test/files/run/bug4671.check new file mode 100644 index 0000000000..dc92c9a72f --- /dev/null +++ b/test/files/run/bug4671.check @@ -0,0 +1,46 @@ +Type in expressions to have them evaluated. +Type :help for more information. + +scala> object o { val file = sys.props("partest.cwd") + "/bug4671.scala" } +defined module o + +scala> val s = scala.io.Source.fromFile(o.file) +s: scala.io.BufferedSource = non-empty iterator + +scala> println(s.getLines.mkString("\n")) +import scala.tools.partest.ReplTest + +object Test extends ReplTest { + // My god...it's full of quines + def code = """ +object o { val file = sys.props("partest.cwd") + "/bug4671.scala" } +val s = scala.io.Source.fromFile(o.file) +println(s.getLines.mkString("\n")) + +val s = scala.io.Source.fromFile(o.file) +println(s.mkString("")) +""".trim +} + +scala> + +scala> val s = scala.io.Source.fromFile(o.file) +s: scala.io.BufferedSource = non-empty iterator + +scala> println(s.mkString("")) +import scala.tools.partest.ReplTest + +object Test extends ReplTest { + // My god...it's full of quines + def code = """ +object o { val file = sys.props("partest.cwd") + "/bug4671.scala" } +val s = scala.io.Source.fromFile(o.file) +println(s.getLines.mkString("\n")) + +val s = scala.io.Source.fromFile(o.file) +println(s.mkString("")) +""".trim +} + + +scala> diff --git a/test/files/run/bug4671.scala b/test/files/run/bug4671.scala new file mode 100644 index 0000000000..0c1e5908bf --- /dev/null +++ b/test/files/run/bug4671.scala @@ -0,0 +1,13 @@ +import scala.tools.partest.ReplTest + +object Test extends ReplTest { + // My god...it's full of quines + def code = """ +object o { val file = sys.props("partest.cwd") + "/bug4671.scala" } +val s = scala.io.Source.fromFile(o.file) +println(s.getLines.mkString("\n")) + +val s = scala.io.Source.fromFile(o.file) +println(s.mkString("")) +""".trim +} |