diff options
author | Som Snytt <som.snytt@gmail.com> | 2013-07-11 14:42:25 -0700 |
---|---|---|
committer | Som Snytt <som.snytt@gmail.com> | 2013-07-11 14:42:25 -0700 |
commit | 138fecfe8f629d3179264647329d628e90d503ff (patch) | |
tree | e278b568ceb20a62885a0a7390f7b58e1f45d758 /test/files/run/repl-save.scala | |
parent | 8b41240f3d532c470112d7bf1f409badac4d56aa (diff) | |
download | scala-138fecfe8f629d3179264647329d628e90d503ff.tar.gz scala-138fecfe8f629d3179264647329d628e90d503ff.tar.bz2 scala-138fecfe8f629d3179264647329d628e90d503ff.zip |
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.
Diffstat (limited to 'test/files/run/repl-save.scala')
-rw-r--r-- | test/files/run/repl-save.scala | 27 |
1 files changed, 18 insertions, 9 deletions
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 |