summaryrefslogtreecommitdiff
path: root/test/files/run
diff options
context:
space:
mode:
authorPaul Phillips <paulp@improving.org>2011-11-04 08:25:30 +0000
committerPaul Phillips <paulp@improving.org>2011-11-04 08:25:30 +0000
commit8006cc6760b30274676ae5359c27b49e5cbf5670 (patch)
tree24fe2d61e0a0068b86e65484ffca97f910d1230c /test/files/run
parent5df51cc5a6ead1f9d68d1e988cda3a1698daf708 (diff)
downloadscala-8006cc6760b30274676ae5359c27b49e5cbf5670.tar.gz
scala-8006cc6760b30274676ae5359c27b49e5cbf5670.tar.bz2
scala-8006cc6760b30274676ae5359c27b49e5cbf5670.zip
Fix for some repl bitrot.
Exception handling beset by entropy. Restored some order. The output of the test may not be stable across platforms, in which case I'll take the usual step of reverting it, thereby achieving victory over failure by testing nothing instead of testing something. No review.
Diffstat (limited to 'test/files/run')
-rw-r--r--test/files/run/repl-exceptions.check25
-rw-r--r--test/files/run/repl-exceptions.scala12
2 files changed, 37 insertions, 0 deletions
diff --git a/test/files/run/repl-exceptions.check b/test/files/run/repl-exceptions.check
new file mode 100644
index 0000000000..f7ce018422
--- /dev/null
+++ b/test/files/run/repl-exceptions.check
@@ -0,0 +1,25 @@
+Type in expressions to have them evaluated.
+Type :help for more information.
+
+scala>
+
+scala> sys.SystemProperties.traceSourcePath setValue ""
+res0: String = null
+
+scala> def f = sys.error("hi mom")
+f: Nothing
+
+scala> f
+[package.error] (package.scala:27)
+(access lastException for the full trace)
+
+scala> lastException.show
+/* The repl internal portion of the stack trace is elided. */
+[package.error] (package.scala:27)
+[.f] (<console>:7)
+[.<init>] (<console>:9)
+[.<clinit>] (<console>:-1)
+
+scala>
+
+scala>
diff --git a/test/files/run/repl-exceptions.scala b/test/files/run/repl-exceptions.scala
new file mode 100644
index 0000000000..aaf37c8ae7
--- /dev/null
+++ b/test/files/run/repl-exceptions.scala
@@ -0,0 +1,12 @@
+import scala.tools.partest.ReplTest
+import scala.tools.util.Javap
+
+object Test extends ReplTest {
+ override def extraSettings = "-Yrich-exceptions"
+ def code = """
+ |sys.SystemProperties.traceSourcePath setValue ""
+ |def f = sys.error("hi mom")
+ |f
+ |lastException.show
+ """.stripMargin
+}