diff options
author | Seth Tisue <seth@tisue.net> | 2015-08-06 15:33:36 -0700 |
---|---|---|
committer | Seth Tisue <seth@tisue.net> | 2015-08-06 15:33:36 -0700 |
commit | 466821defd57f1d99cf4852e2b9c374979a05f98 (patch) | |
tree | 1ab0db21025dd248a285122f2177bb1867dca61f /test | |
parent | d5f5b26e6fcf69df7b6ceb3e72e7fa15af8538a8 (diff) | |
parent | 23203f72c763ac847de763573731310989e84b2a (diff) | |
download | scala-466821defd57f1d99cf4852e2b9c374979a05f98.tar.gz scala-466821defd57f1d99cf4852e2b9c374979a05f98.tar.bz2 scala-466821defd57f1d99cf4852e2b9c374979a05f98.zip |
Merge pull request #4648 from Ichoran/issue/8554-again
SI-8554 Two-arg remove now throws exception on overly-large count
Diffstat (limited to 'test')
-rw-r--r-- | test/files/run/t6634.check | 6 | ||||
-rw-r--r-- | test/files/run/t6634.scala | 21 |
2 files changed, 16 insertions, 11 deletions
diff --git a/test/files/run/t6634.check b/test/files/run/t6634.check index f6cbb30c67..b085f397e6 100644 --- a/test/files/run/t6634.check +++ b/test/files/run/t6634.check @@ -4,27 +4,31 @@ String OK. Length OK. Trying lb1 ... +java.lang.IndexOutOfBoundsException: at 6 deleting 6 Checking ... String OK. Length OK. Trying lb2 ... +java.lang.IndexOutOfBoundsException: at 99 deleting 6 Checking ... String OK. Length OK. Trying lb3 ... +java.lang.IndexOutOfBoundsException: at 1 deleting 9 Checking ... String OK. Length OK. Trying lb4 ... +java.lang.IndexOutOfBoundsException: at -1 deleting 1 Checking ... String OK. Length OK. Trying lb5 ... -java.lang.IllegalArgumentException: removing negative number (-1) of elements +java.lang.IllegalArgumentException: removing negative number of elements: -1 Checking ... String OK. Length OK. diff --git a/test/files/run/t6634.scala b/test/files/run/t6634.scala index 759e6d519d..081cca7502 100644 --- a/test/files/run/t6634.scala +++ b/test/files/run/t6634.scala @@ -8,7 +8,7 @@ object Test extends App { try { lb0.remove(5, 0) } catch { - // Not thrown in 2.10, will be thrown in 2.11 + // Should not be thrown--nothing is deleted so nothing to do case ex: IndexOutOfBoundsException => println(ex) } checkNotCorrupted(lb0) @@ -17,8 +17,8 @@ object Test extends App { println("Trying lb1 ...") try { lb1.remove(6, 6) - } catch { - // Not thrown in 2.10, will be thrown in 2.11 + } catch { + // Not thrown in 2.11, is thrown in 2.12 case ex: IndexOutOfBoundsException => println(ex) } checkNotCorrupted(lb1) @@ -28,7 +28,7 @@ object Test extends App { try { lb2.remove(99, 6) } catch { - // Not thrown in 2.10, will be thrown in 2.11 + // Not thrown in 2.11, is thrown in 2.12 case ex: IndexOutOfBoundsException => println(ex) } checkNotCorrupted(lb2) @@ -38,26 +38,27 @@ object Test extends App { try { lb3.remove(1, 9) } catch { - // Not thrown in 2.10, will be thrown in 2.11 - case ex: IllegalArgumentException => println(ex) + // Not thrown in 2.11, is thrown in 2.12 + case ex: IndexOutOfBoundsException => println(ex) } - checkNotCorrupted(lb3, "ListBuffer('a)", 1) + checkNotCorrupted(lb3) val lb4 = newLB println("Trying lb4 ...") try { lb4.remove(-1, 1) } catch { - // Not thrown in 2.10, will be thrown in 2.11 + // Not thrown in 2.11, is thrown in 2.12 case ex: IndexOutOfBoundsException => println(ex) } - checkNotCorrupted(lb4, "ListBuffer('b, 'c, 'd, 'e)", 4) + checkNotCorrupted(lb4) val lb5 = newLB println("Trying lb5 ...") try { lb5.remove(1, -1) } catch { + // Was thrown prior to 2.12 also case ex: IllegalArgumentException => println(ex) } checkNotCorrupted(lb5) @@ -77,4 +78,4 @@ object Test extends App { else println("!!! length FAILED: " + len) println() } -}
\ No newline at end of file +} |