Update corelib/list_test for default exception type change.

R=brianwilkerson@google.com

Change-Id: I2bb89d5c422872ba5008c6375b8f27b02b9a95c5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/146683
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
This commit is contained in:
Konstantin Shcheglov 2020-05-05 22:25:27 +00:00 committed by commit-bot@chromium.org
parent a305eb6969
commit 20917915bb
2 changed files with 4 additions and 4 deletions

View file

@ -54,7 +54,7 @@ void testErrors() {
testIndexError(list, index, name) {
try {
list[list.length];
} catch (err, s) {
} on RangeError catch (err, s) {
Expect.isTrue(err is RangeError, "$name[$index]");
Expect.equals(list.length, err.invalidValue, "$name[$index] value");
Expect.equals(list.length - 1, err.end, "$name[$index] end");
@ -81,7 +81,7 @@ void testErrors() {
var result;
try {
result = list.sublist(start, end);
} catch (actualError) {
} on RangeError catch (actualError) {
Expect.isNotNull(realError, "$name should not fail");
Expect.isTrue(actualError is RangeError, "$name is-error: $actualError");
Expect.equals(realError.name, actualError.name, "$name name");

View file

@ -56,7 +56,7 @@ void testErrors() {
testIndexError(list, index, name) {
try {
list[list.length];
} catch (err, s) {
} on RangeError catch (err, s) {
Expect.isTrue(err is RangeError, "$name[$index]");
Expect.equals(list.length, err.invalidValue, "$name[$index] value");
Expect.equals(list.length - 1, err.end, "$name[$index] end");
@ -83,7 +83,7 @@ void testErrors() {
var result;
try {
result = list.sublist(start, end);
} catch (actualError) {
} on RangeError catch (actualError) {
Expect.isNotNull(realError, "$name should not fail");
Expect.isTrue(actualError is RangeError, "$name is-error: $actualError");
Expect.equals(realError.name, actualError.name, "$name name");