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

Side by Side Diff: tests/corelib/list_test.dart

Issue 14042012: More fixes. Thanks to Slava for reminding me of check-function-fingerprints flag. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « runtime/vm/flow_graph_builder.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 import "dart:collection"; 5 import "dart:collection";
6 import "dart:typeddata"; 6 import "dart:typed_data";
7 import "package:expect/expect.dart"; 7 import "package:expect/expect.dart";
8 8
9 void main() { 9 void main() {
10 // Fixed length lists, length 4. 10 // Fixed length lists, length 4.
11 testFixedLengthList(new List(4)); 11 testFixedLengthList(new List(4));
12 testFixedLengthList(new List(4).toList(growable: false)); 12 testFixedLengthList(new List(4).toList(growable: false));
13 testFixedLengthList((new List()..length = 4).toList(growable: false)); 13 testFixedLengthList((new List()..length = 4).toList(growable: false));
14 // ListBase implementation of List. 14 // ListBase implementation of List.
15 testFixedLengthList(new MyFixedList(new List(4))); 15 testFixedLengthList(new MyFixedList(new List(4)));
16 testFixedLengthList(new MyFixedList(new List(4)).toList(growable: false)); 16 testFixedLengthList(new MyFixedList(new List(4)).toList(growable: false));
(...skipping 297 matching lines...) Expand 10 before | Expand all | Expand 10 after
314 } 314 }
315 315
316 class MyFixedList<E> extends ListBase<E> { 316 class MyFixedList<E> extends ListBase<E> {
317 List<E> _source; 317 List<E> _source;
318 MyFixedList(this._source); 318 MyFixedList(this._source);
319 int get length => _source.length; 319 int get length => _source.length;
320 void set length(int length) { throw new UnsupportedError("Fixed length!"); } 320 void set length(int length) { throw new UnsupportedError("Fixed length!"); }
321 E operator[](int index) => _source[index]; 321 E operator[](int index) => _source[index];
322 void operator[]=(int index, E value) { _source[index] = value; } 322 void operator[]=(int index, E value) { _source[index] = value; }
323 } 323 }
OLDNEW
« no previous file with comments | « runtime/vm/flow_graph_builder.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698