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

Unified Diff: tests/corelib/list_test.dart

Issue 14178017: Mark list_test as failing on browsers. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Moved argument checking checking away from typed arrays for now Created 7 years, 8 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
« tests/corelib/corelib.status ('K') | « 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_test.dart
diff --git a/tests/corelib/list_test.dart b/tests/corelib/list_test.dart
index e4a7178efe70e9f7ac273a1bd4d32592b78839d4..28629a95d7f2ee6848ee56ac92ac8aef90ef2774 100644
--- a/tests/corelib/list_test.dart
+++ b/tests/corelib/list_test.dart
@@ -152,6 +152,29 @@ void testTypedLengthInvariantOperations(List list) {
Expect.isTrue(list.any(matchSomeLast));
Expect.isFalse(list.any(matchNone));
+ // Argument checking isn't implemented for typed arrays in browsers,
+ // so it's moved to the method below for now.
+}
+
+void testLengthInvariantOperations(List list) {
+ testTypedLengthInvariantOperations(list);
+ // Tests that need untyped lists.
+ list.setAll(0, [0, 1, 2, 3]);
+ Expect.equals(-1, list.indexOf(100));
+ Expect.equals(-1, list.lastIndexOf(100));
+ list[2] = new Yes();
+ Expect.equals(2, list.indexOf(100));
+ Expect.equals(2, list.lastIndexOf(100));
+ list[3] = new Yes();
+ Expect.equals(2, list.indexOf(100));
+ Expect.equals(3, list.lastIndexOf(100));
+ list[2] = 2;
+ Expect.equals(3, list.indexOf(100));
+ Expect.equals(3, list.lastIndexOf(100));
+ list[3] = 3;
+ Expect.equals(-1, list.indexOf(100));
+ Expect.equals(-1, list.lastIndexOf(100));
+
// Argument errors on bad indices. List is still [0, 1, 2, 3].
testArgumentError(action()) {
Expect.throws(action, (e) => e is ArgumentError);
@@ -187,27 +210,6 @@ void testTypedLengthInvariantOperations(List list) {
testArgumentError(() => list.fillRange(4, 2));
}
-void testLengthInvariantOperations(List list) {
- testTypedLengthInvariantOperations(list);
- // Tests that need untyped lists.
- list.setAll(0, [0, 1, 2, 3]);
- Expect.equals(-1, list.indexOf(100));
- Expect.equals(-1, list.lastIndexOf(100));
- list[2] = new Yes();
- Expect.equals(2, list.indexOf(100));
- Expect.equals(2, list.lastIndexOf(100));
- list[3] = new Yes();
- Expect.equals(2, list.indexOf(100));
- Expect.equals(3, list.lastIndexOf(100));
- list[2] = 2;
- Expect.equals(3, list.indexOf(100));
- Expect.equals(3, list.lastIndexOf(100));
- list[3] = 3;
- Expect.equals(-1, list.indexOf(100));
- Expect.equals(-1, list.lastIndexOf(100));
-
-}
-
void testTypedList(List list) {
testTypedLengthInvariantOperations(list);
testCannotChangeLength(list);
« tests/corelib/corelib.status ('K') | « tests/corelib/corelib.status ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698