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

Unified Diff: tests/language/src/ListTest.dart

Issue 9007015: Fix issue 920: do not allow length of a list go below 0. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: '' Created 9 years 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 | « runtime/lib/growable_array.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/language/src/ListTest.dart
===================================================================
--- tests/language/src/ListTest.dart (revision 2646)
+++ tests/language/src/ListTest.dart (working copy)
@@ -137,6 +137,16 @@
exceptionCaught = true;
}
Expect.equals(true, exceptionCaught);
+
+ exceptionCaught = false;
+ List list = new List();
+ try {
+ list.removeLast();
+ } catch (IndexOutOfRangeException e) {
+ exceptionCaught = true;
+ }
+ Expect.equals(0, list.length);
+ Expect.equals(true, exceptionCaught);
}
}
« no previous file with comments | « runtime/lib/growable_array.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698