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

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

Issue 2992833002: Migrated test block 15 to Dart 2.0. (Closed)
Patch Set: 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) 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
3 // BSD-style license that can be found in the LICENSE file.
4
5 import "package:expect/expect.dart";
6 import 'dart:collection';
7
8 class MyList extends ListBase {
9 final list;
10 MyList(this.list);
11
12 get length => list.length;
13 set length(val) {
14 list.length = val;
15 }
16
17 operator [](index) => list[index];
18 operator []=(index, val) => list[index] = val;
19 }
20
21 main() {
22 Expect.equals("[]", [].toString());
23 Expect.equals("[1]", [1].toString());
24 Expect.equals("[1, 2]", [1, 2].toString());
25 Expect.equals("[]", const [].toString());
26 Expect.equals("[1]", const [1].toString());
27 Expect.equals("[1, 2]", const [1, 2].toString());
28 Expect.equals("[]", new MyList([]).toString());
29 Expect.equals("[1]", new MyList([1]).toString());
30 Expect.equals("[1, 2]", new MyList([1, 2]).toString());
31 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698