mirror of
https://github.com/dart-lang/sdk
synced 2024-10-03 00:29:50 +00:00
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:
parent
a305eb6969
commit
20917915bb
|
@ -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");
|
||||
|
|
|
@ -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");
|
||||
|
|
Loading…
Reference in a new issue