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

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

Issue 17977002: - Remove arguments definition test from the VM. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 5 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 | « tests/corelib/iterable_join_test.dart ('k') | tests/language/argument_definition2_test.dart » ('j') | 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) 2013, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2013, 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 "package:expect/expect.dart"; 5 import "package:expect/expect.dart";
6 import "dart:collection"; 6 import "dart:collection";
7 7
8 test(List list, int start, int end, [fillValue]) { 8 test(List list, int start, int end, [fillValue]) {
9 List copy = list.toList(); 9 List copy = list.toList();
10 if (?fillValue) { 10 list.fillRange(start, end, fillValue);
11 list.fillRange(start, end, fillValue);
12 } else {
13 list.fillRange(start, end, fillValue);
14 }
15 Expect.equals(copy.length, list.length); 11 Expect.equals(copy.length, list.length);
16 for (int i = 0; i < start; i++) { 12 for (int i = 0; i < start; i++) {
17 Expect.equals(copy[i], list[i]); 13 Expect.equals(copy[i], list[i]);
18 } 14 }
19 for (int i = start; i < end; i++) { 15 for (int i = start; i < end; i++) {
20 Expect.equals(fillValue, list[i]); 16 Expect.equals(fillValue, list[i]);
21 } 17 }
22 for (int i = end; i < list.length; i++) { 18 for (int i = end; i < list.length; i++) {
23 Expect.equals(copy[i], list[i]); 19 Expect.equals(copy[i], list[i]);
24 } 20 }
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
69 expectUE(() => test(const [1, 2, 3], 1, 4)); 65 expectUE(() => test(const [1, 2, 3], 1, 4));
70 } 66 }
71 67
72 void expectRE(Function f) { 68 void expectRE(Function f) {
73 Expect.throws(f, (e) => e is RangeError); 69 Expect.throws(f, (e) => e is RangeError);
74 } 70 }
75 71
76 void expectUE(Function f) { 72 void expectUE(Function f) {
77 Expect.throws(f, (e) => e is UnsupportedError); 73 Expect.throws(f, (e) => e is UnsupportedError);
78 } 74 }
OLDNEW
« no previous file with comments | « tests/corelib/iterable_join_test.dart ('k') | tests/language/argument_definition2_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698