diff options
author | Jason Zaugg <jzaugg@gmail.com> | 2013-09-08 00:38:43 -0700 |
---|---|---|
committer | Jason Zaugg <jzaugg@gmail.com> | 2013-09-08 00:38:43 -0700 |
commit | e3968a5a40b09218990f2f7bc3e449d68cd2cf02 (patch) | |
tree | acc10917a415184f8e9f66fa3f355caebe1b1b1d /test/files | |
parent | 45a7da1426586e9fe2abe19b41a296e76ef1d78a (diff) | |
parent | e8af579a4442b3cda9ea82ddc1ce7f9bd6899418 (diff) | |
download | scala-e3968a5a40b09218990f2f7bc3e449d68cd2cf02.tar.gz scala-e3968a5a40b09218990f2f7bc3e449d68cd2cf02.tar.bz2 scala-e3968a5a40b09218990f2f7bc3e449d68cd2cf02.zip |
Merge pull request #2885 from som-snytt/issue/7791-script-linenums
SI-7791 Line number table reflects underlying file
Diffstat (limited to 'test/files')
-rw-r--r-- | test/files/run/t7791-script-linenums.check | 1 | ||||
-rw-r--r-- | test/files/run/t7791-script-linenums.scala | 16 | ||||
-rw-r--r-- | test/files/run/t7791-script-linenums.script | 8 |
3 files changed, 25 insertions, 0 deletions
diff --git a/test/files/run/t7791-script-linenums.check b/test/files/run/t7791-script-linenums.check new file mode 100644 index 0000000000..b7d969564a --- /dev/null +++ b/test/files/run/t7791-script-linenums.check @@ -0,0 +1 @@ +hello, scripted test diff --git a/test/files/run/t7791-script-linenums.scala b/test/files/run/t7791-script-linenums.scala new file mode 100644 index 0000000000..d89b8d4c63 --- /dev/null +++ b/test/files/run/t7791-script-linenums.scala @@ -0,0 +1,16 @@ + +import scala.tools.partest.ScriptTest + +object Test extends ScriptTest { + object ExceptionLine { + def unapply(e: Exception) = Some(e.getStackTrace()(0).getLineNumber) + } + override def show() = { + import util._ + Try(super.show()) match { + case Failure(ExceptionLine(7)) => () + case Failure(e) => e.printStackTrace() + case Success(_) => Console println "Expected error" + } + } +} diff --git a/test/files/run/t7791-script-linenums.script b/test/files/run/t7791-script-linenums.script new file mode 100644 index 0000000000..403dcc2d28 --- /dev/null +++ b/test/files/run/t7791-script-linenums.script @@ -0,0 +1,8 @@ +#!/bin/bash +exec ${SCALA_HOME}/bin/scala "$0" "$@" 2>&1 +!# + +Console println s"hello, scripted test" + +throw new RuntimeException("failing") // line 7 + |