Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(29)

Unified Diff: tests/corelib/list_removeat_test.dart

Issue 10960011: Made removeAt errors consistent between dart2js and VM. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Address comment. Created 8 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « tests/corelib/corelib.status ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/corelib/list_removeat_test.dart
diff --git a/tests/corelib/list_removeat_test.dart b/tests/corelib/list_removeat_test.dart
index a690f2a999b05e4021073b554b0bfebc90c5f6ac..ba7acf2c760ca45da496477ce97c80067ad3babd 100644
--- a/tests/corelib/list_removeat_test.dart
+++ b/tests/corelib/list_removeat_test.dart
@@ -6,6 +6,9 @@ void main() {
// Normal modifiable list.
var l1 = [0, 1, 2, 3, 4];
+ bool checkedMode = false;
+ assert(checkedMode = true);
+
// Index must be integer and in range.
Expect.throws(() { l1.removeAt(-1); },
(e) => e is IndexOutOfRangeException,
@@ -13,11 +16,16 @@ void main() {
Expect.throws(() { l1.removeAt(5); },
(e) => e is IndexOutOfRangeException,
"too large");
- Expect.throws(() { l1.removeAt("1"); },
+ Expect.throws(() { l1.removeAt(null); },
(e) => e is IllegalArgumentException,
+ "too large");
+ Expect.throws(() { l1.removeAt("1"); },
+ (e) => (checkedMode ? e is TypeError
+ : e is IllegalArgumentException),
"string");
Expect.throws(() { l1.removeAt(1.5); },
- (e) => e is IllegalArgumentException,
+ (e) => (checkedMode ? e is TypeError
+ : e is IllegalArgumentException),
"double");
Expect.equals(2, l1.removeAt(2), "l1-remove2");
« no previous file with comments | « tests/corelib/corelib.status ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698