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

Side by Side Diff: tests/corelib_strong/list_growable_test.dart

Issue 2994543002: Migrated test block 13 to Dart 2.0. (Closed)
Patch Set: Address Bob's nits Created 3 years, 4 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
OLDNEW
(Empty)
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
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.
4
5 import "package:expect/expect.dart";
6
7 main() {
8 var a;
9 a = new List();
10 a.add(499);
11 Expect.equals(1, a.length);
12 Expect.equals(499, a[0]);
13 a.clear();
14 Expect.equals(0, a.length);
15 Expect.throws(() => a[0], (e) => e is RangeError);
16
17 a = new List(42).toList();
18 Expect.equals(42, a.length);
19 a.add(499);
20 Expect.equals(43, a.length);
21 Expect.equals(499, a[42]);
22 Expect.equals(null, a[23]);
23 a.clear();
24 Expect.equals(0, a.length);
25 Expect.throws(() => a[0], (e) => e is RangeError);
26
27 a = new List<int>(42).toList();
28 Expect.equals(42, a.length);
29 a.add(499);
30 Expect.equals(43, a.length);
31 Expect.equals(499, a[42]);
32 for (int i = 0; i < 42; i++) {
33 Expect.equals(null, a[i]);
34 }
35 a.clear();
36 Expect.equals(0, a.length);
37 Expect.throws(() => a[0], (e) => e is RangeError);
38 }
OLDNEW
« no previous file with comments | « tests/corelib_strong/list_get_range_test.dart ('k') | tests/corelib_strong/list_index_of2_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698