summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorSom Snytt <som.snytt@gmail.com>2013-07-11 14:42:25 -0700
committerSom Snytt <som.snytt@gmail.com>2013-07-11 14:42:25 -0700
commit138fecfe8f629d3179264647329d628e90d503ff (patch)
treee278b568ceb20a62885a0a7390f7b58e1f45d758 /test
parent8b41240f3d532c470112d7bf1f409badac4d56aa (diff)
downloadscala-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')
-rw-r--r--test/files/run/repl-save.check15
-rw-r--r--test/files/run/repl-save.scala27
2 files changed, 18 insertions, 24 deletions
diff --git a/test/files/run/repl-save.check b/test/files/run/repl-save.check
index 7ed769278f..5f928688d0 100644
--- a/test/files/run/repl-save.check
+++ b/test/files/run/repl-save.check
@@ -1,18 +1,3 @@
-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 repl-save-run.obj/session.repl
-
-scala>
val i = 7
val j = 8
i * j
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