summaryrefslogtreecommitdiff
path: root/test/files/run/repl-paste-2.scala
diff options
context:
space:
mode:
authorPaul Phillips <paulp@improving.org>2011-03-15 02:56:58 +0000
committerPaul Phillips <paulp@improving.org>2011-03-15 02:56:58 +0000
commite96dba0c9a2467c6cf396c70a48ef0750503c26e (patch)
treeb31f7e00f5d3257dc38b1316ccd71c94e0d1fe9e /test/files/run/repl-paste-2.scala
parent7a29fc7de3465a064ffc6e0422d5df4bf39b36a3 (diff)
downloadscala-e96dba0c9a2467c6cf396c70a48ef0750503c26e.tar.gz
scala-e96dba0c9a2467c6cf396c70a48ef0750503c26e.tar.bz2
scala-e96dba0c9a2467c6cf396c70a48ef0750503c26e.zip
Various chronic annoyances with the repl addres...
Various chronic annoyances with the repl addressed. Much improved transcript pasting. Now goes back in time to fix the transcript if it contains self-referential "res0, res1" etc. so that it works as it originally did. Shows which commands it is running, and places the commands with their result in a manner suitable for framing. Also, a new :paste command which accepts input up to ctrl-D, so you can enter companions without gyrations, or code from people who write in a repl unfriendly fashion by putting their curly braces on the next line (I'm looking at you mark harrah) or you name it, it's not picky. No review.
Diffstat (limited to 'test/files/run/repl-paste-2.scala')
-rw-r--r--test/files/run/repl-paste-2.scala28
1 files changed, 28 insertions, 0 deletions
diff --git a/test/files/run/repl-paste-2.scala b/test/files/run/repl-paste-2.scala
new file mode 100644
index 0000000000..802c627701
--- /dev/null
+++ b/test/files/run/repl-paste-2.scala
@@ -0,0 +1,28 @@
+import scala.tools.partest.ReplTest
+
+object Test extends ReplTest {
+ def code = """
+scala> 123
+res0: Int = 123
+
+scala> 567
+res1: Int = 567
+
+scala> res0 + res1
+res2: Int = 690
+
+scala> val x = dingus
+<console>:7: error: not found: value dingus
+ val x = dingus
+ ^
+
+scala> val x = "dingus"
+x: java.lang.String = dingus
+
+scala> x.length
+res3: Int = 6
+
+scala> x.length + res3
+res4: Int = 12
+ """
+} \ No newline at end of file