summaryrefslogtreecommitdiff
path: root/test/files
diff options
context:
space:
mode:
authorPaul Phillips <paulp@improving.org>2013-05-11 13:16:10 -0700
committerPaul Phillips <paulp@improving.org>2013-05-11 13:16:10 -0700
commit7f29f8512d4975cf3a5a0b536a8910e4e3b4316b (patch)
tree35925e6a23b5fc3f31799e2f48cd5020bd52c07e /test/files
parentc85a507ba815643faacd8e07270efbd83b700846 (diff)
parent6890f382baec625e01c3850243d826645c60dbe6 (diff)
downloadscala-7f29f8512d4975cf3a5a0b536a8910e4e3b4316b.tar.gz
scala-7f29f8512d4975cf3a5a0b536a8910e4e3b4316b.tar.bz2
scala-7f29f8512d4975cf3a5a0b536a8910e4e3b4316b.zip
Merge pull request #2470 from ihji/master
SI-7432 Range.min should throw NoSuchElementException on empty range
Diffstat (limited to 'test/files')
-rw-r--r--test/files/run/range.scala11
1 files changed, 11 insertions, 0 deletions
diff --git a/test/files/run/range.scala b/test/files/run/range.scala
index f08b2105d3..b81e67921a 100644
--- a/test/files/run/range.scala
+++ b/test/files/run/range.scala
@@ -16,6 +16,17 @@ object Test {
catch { case _: IllegalArgumentException => true }
)
assert(caught)
+ // #7432
+ val noElemAtMin = (
+ try { (10 until 10).min ; false }
+ catch { case _: NoSuchElementException => true }
+ )
+ assert(noElemAtMin)
+ val noElemAtMax = (
+ try { (10 until 10).max ; false }
+ catch { case _: NoSuchElementException => true }
+ )
+ assert(noElemAtMax)
}
case class GR[T](val x: T)(implicit val num: Integral[T]) {