diff options
author | Jason Zaugg <jzaugg@gmail.com> | 2016-03-29 10:01:24 +1000 |
---|---|---|
committer | Jason Zaugg <jzaugg@gmail.com> | 2016-03-29 10:01:24 +1000 |
commit | d40f1b81372e1cdb101790d14c5bc8c7c304c128 (patch) | |
tree | 50eeb15e70e9714bcdf18940969d376c84009fe5 /test/files | |
parent | ca606e6943c405e487c54c3fd14a3a8ac917bb2e (diff) | |
download | scala-d40f1b81372e1cdb101790d14c5bc8c7c304c128.tar.gz scala-d40f1b81372e1cdb101790d14c5bc8c7c304c128.tar.bz2 scala-d40f1b81372e1cdb101790d14c5bc8c7c304c128.zip |
SI-7474 Record extra errors in Throwable#suppressedExceptions
... in parallel collection operations.
Followup to bcbe38d18, which did away with the the approach to
use a composite exception when more than one error happened.
Diffstat (limited to 'test/files')
-rw-r--r-- | test/files/run/t5375.check | 1 | ||||
-rw-r--r-- | test/files/run/t5375.scala | 16 |
2 files changed, 12 insertions, 5 deletions
diff --git a/test/files/run/t5375.check b/test/files/run/t5375.check index b1a57eeeec..e69de29bb2 100644 --- a/test/files/run/t5375.check +++ b/test/files/run/t5375.check @@ -1 +0,0 @@ -Runtime exception diff --git a/test/files/run/t5375.scala b/test/files/run/t5375.scala index 826ecd841e..2028b6f05d 100644 --- a/test/files/run/t5375.scala +++ b/test/files/run/t5375.scala @@ -1,8 +1,16 @@ object Test extends App { val foos = (1 to 1000).toSeq - try - foos.par.map(i => if (i % 37 == 0) sys.error("i div 37") else i) - catch { - case ex: RuntimeException => println("Runtime exception") + try { + foos.par.map(i => if (i % 37 == 0) throw new MultipleOf37Exception(i) else i) + assert(false) + } catch { + case ex: MultipleOf37Exception => + assert(ex.getSuppressed.size > 0) + assert(ex.getSuppressed.forall(_.isInstanceOf[MultipleOf37Exception])) + assert(ex.i == 37) + assert(ex.getSuppressed.map(_.asInstanceOf[MultipleOf37Exception].i).toList == List(74, 148, 259, 518)) + case _: Throwable => + assert(false) } + class MultipleOf37Exception(val i: Int) extends RuntimeException } |