summaryrefslogtreecommitdiff
path: root/test/files/run
diff options
context:
space:
mode:
Diffstat (limited to 'test/files/run')
-rw-r--r--test/files/run/t2813.2.scala39
1 files changed, 39 insertions, 0 deletions
diff --git a/test/files/run/t2813.2.scala b/test/files/run/t2813.2.scala
new file mode 100644
index 0000000000..4d37f5e69d
--- /dev/null
+++ b/test/files/run/t2813.2.scala
@@ -0,0 +1,39 @@
+import java.util.LinkedList
+import collection.JavaConversions._
+
+object Test extends Application {
+ def assertListEquals[A](expected: List[A], actual: Seq[A]) {
+ assert(expected.sameElements(actual),
+ "Expected list to contain " + expected.mkString("[", ", ", "]") +
+ ", but was " + actual.mkString("[", ", ", "]"))
+ }
+
+ def addAllOfNonCollectionWrapperAtZeroOnEmptyLinkedList() {
+ val l = new LinkedList[Int]
+ l.addAll(0, List(1, 2))
+ assertListEquals(List(1, 2), l)
+ }
+
+ def addAllOfNonCollectionWrapperAtZeroOnLinkedList() {
+ val l = new LinkedList[Int] + 1 + 2
+ l.addAll(0, List(10, 11))
+ assertListEquals((List(10, 11, 1, 2)), l)
+ }
+
+ def addAllOfCollectionWrapperAtZeroOnLinkedList() {
+ val l = new LinkedList[Int] + 1 + 2
+ l.addAll(0, new LinkedList[Int] + 10 + 11)
+ assertListEquals((List(10, 11, 1, 2)), l)
+ }
+
+ def addAllOfCollectionWrapperAtZeroOnEmptyLinkedList() {
+ val l = new LinkedList[Int]
+ l.addAll(0, new LinkedList[Int] + 10 + 11)
+ assertListEquals((List(10, 11)), l)
+ }
+
+ addAllOfNonCollectionWrapperAtZeroOnEmptyLinkedList
+ addAllOfNonCollectionWrapperAtZeroOnLinkedList
+ addAllOfCollectionWrapperAtZeroOnEmptyLinkedList
+ addAllOfCollectionWrapperAtZeroOnLinkedList
+}