From 300cb9e1ee6559ea08b58b04dd89de94e4449fce Mon Sep 17 00:00:00 2001 From: Paul Phillips Date: Fri, 1 Jul 2011 06:58:03 +0000 Subject: Keep BufferedSource from losing buffered data w... Keep BufferedSource from losing buffered data when a derivative iterator is created via getLines. Closes #4671, #4662, no review. --- test/files/run/bug4671.scala | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 test/files/run/bug4671.scala (limited to 'test/files/run/bug4671.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 +} -- cgit v1.2.3