Chromium Code Reviews| Index: tests/corelib/list_removeat_test.dart |
| diff --git a/tests/corelib/list_removeat_test.dart b/tests/corelib/list_removeat_test.dart |
| index 758e9204dffd2f0721cfd0daa417ad1f89f77636..ca058835de5f3b24f468ff6004ea65113a5d3b67 100644 |
| --- a/tests/corelib/list_removeat_test.dart |
| +++ b/tests/corelib/list_removeat_test.dart |
| @@ -20,11 +20,18 @@ class MyList extends ListBase { |
| String toString() => "[" + join(", ") + "]"; |
| } |
| +final bool isCheckedMode = (() { |
| + try { |
| + var i = 42; |
| + String s = i; |
| + } on TypeError catch (e) { |
| + return true; |
| + } |
| + return false; |
| +})(); |
|
sra1
2017/05/24 01:30:46
delete
eernst
2017/07/07 08:50:29
Done.
|
| + |
| // l1 must be a modifiable list with 5 elements from 0 to 4. |
| void testModifiableList(l1) { |
| - bool checkedMode = false; |
| - assert(checkedMode = true); |
| - |
| // Index must be integer and in range. |
| Expect.throws(() { |
| l1.removeAt(-1); |
| @@ -37,10 +44,12 @@ void testModifiableList(l1) { |
| }, (e) => e is ArgumentError, "too large"); |
| Expect.throws(() { |
| l1.removeAt("1"); |
| - }, (e) => (checkedMode ? e is TypeError : e is ArgumentError), "string"); |
| + }, (e) => (typeAssertionsEnabled ? e is TypeError : e is ArgumentError), |
| + "string"); |
| Expect.throws(() { |
| l1.removeAt(1.5); |
| - }, (e) => (checkedMode ? e is TypeError : e is ArgumentError), "double"); |
| + }, (e) => (typeAssertionsEnabled ? e is TypeError : e is ArgumentError), |
| + "double"); |
| Expect.equals(2, l1.removeAt(2), "l1-remove2"); |
| Expect.equals(1, l1[1], "l1-1[1]"); |