Adjust various testData to remove/charAt transformation
This commit is contained in:
+1
-1
@@ -11,7 +11,7 @@ fun box(): Boolean {
|
||||
|
||||
// test addAt
|
||||
list.add(0, 400)
|
||||
list.remove(0);
|
||||
list.removeAt(0);
|
||||
list.add(1, 500)
|
||||
// test contains, addAll
|
||||
if (!list.contains(500) || list.contains(600) || list.addAll(ArrayList<Int>())) {
|
||||
|
||||
@@ -8,7 +8,7 @@ fun box(): Boolean {
|
||||
arr.add(i)
|
||||
}
|
||||
|
||||
val removedElement = arr.remove(2)
|
||||
val removed = arr.remove(4: Any)
|
||||
val removedElement = arr.removeAt(2)
|
||||
val removed = arr.remove(4)
|
||||
return arr.size() == 4 && removedElement == 2 && removed && arr[0] == 0 && arr[1] == 1 && arr[2] == 3 && arr[3] == 5
|
||||
}
|
||||
+2
-2
@@ -7,7 +7,7 @@ fun box(): Boolean {
|
||||
|
||||
val arr = ArrayList<Int>()
|
||||
try {
|
||||
arr.remove(2)
|
||||
arr.removeAt(2)
|
||||
}
|
||||
catch(e: IndexOutOfBoundsException) {
|
||||
threwForEmptyList = true
|
||||
@@ -20,7 +20,7 @@ fun box(): Boolean {
|
||||
var threwForFilled = false
|
||||
|
||||
try {
|
||||
arr.remove(20)
|
||||
arr.removeAt(20)
|
||||
}
|
||||
catch(e: IndexOutOfBoundsException) {
|
||||
threwForFilled = true
|
||||
|
||||
Reference in New Issue
Block a user