summaryrefslogtreecommitdiff
path: root/test/files/run
diff options
context:
space:
mode:
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
+}