From 138fecfe8f629d3179264647329d628e90d503ff Mon Sep 17 00:00:00 2001 From: Som Snytt Date: Thu, 11 Jul 2013 14:42:25 -0700 Subject: Fix repl-save test Make the test a SessionTest, where the file name appears just once, in the transcript, and is trivially compared against itself. The contents of the saved file are still output and compared with the check file. --- test/files/run/repl-save.scala | 27 ++++++++++++++++++--------- 1 file changed, 18 insertions(+), 9 deletions(-) (limited to 'test/files/run/repl-save.scala') diff --git a/test/files/run/repl-save.scala b/test/files/run/repl-save.scala index 465aff225b..4539790b1a 100644 --- a/test/files/run/repl-save.scala +++ b/test/files/run/repl-save.scala @@ -1,14 +1,23 @@ -import scala.tools.partest.ReplTest +import scala.tools.partest.SessionTest -object Test extends ReplTest { - def code = s""" - |val i = 7 - |val j = 8 - |i * j - |:save $saveto - """.stripMargin.trim +object Test extends SessionTest { + def session = +s"""|Type in expressions to have them evaluated. + |Type :help for more information. + | + |scala> val i = 7 + |i: Int = 7 + | + |scala> val j = 8 + |j: Int = 8 + | + |scala> i * j + |res0: Int = 56 + | + |scala> :save $saveto + | + |scala> """ def saveto = testOutput / "session.repl" - override def show() = { super.show() Console print saveto.toFile.slurp -- cgit v1.2.3