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

Side by Side Diff: tests/compiler/dart2js_extra/compound_operator_index_test.dart

Issue 2345083003: dart2js: run dartfmt on tests (Closed)
Patch Set: revert another multipart test Created 4 years, 3 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
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 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 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 6
7 class A { 7 class A {
8 List<int> list; 8 List<int> list;
9 A(int a, int b) : list = <int>[a, b]; 9 A(int a, int b) : list = <int>[a, b];
10 operator [](index) => list[index]; 10 operator [](index) => list[index];
(...skipping 25 matching lines...) Expand all
36 trace.add(value); 36 trace.add(value);
37 this.value = this.value + 1; 37 this.value = this.value + 1;
38 return this; 38 return this;
39 } 39 }
40 } 40 }
41 41
42 B getB(trace) { 42 B getB(trace) {
43 trace.add(-1); 43 trace.add(-1);
44 return new B(trace); 44 return new B(trace);
45 } 45 }
46
46 int getIndex(trace) { 47 int getIndex(trace) {
47 trace.add(-2); 48 trace.add(-2);
48 return 42; 49 return 42;
49 } 50 }
50 51
51 main() { 52 main() {
52 A a = new A(1, 2); 53 A a = new A(1, 2);
53 Expect.equals(1, a[0]); 54 Expect.equals(1, a[0]);
54 Expect.equals(2, a[1]); 55 Expect.equals(2, a[1]);
55 56
(...skipping 10 matching lines...) Expand all
66 Expect.equals(1, a[0]); 67 Expect.equals(1, a[0]);
67 68
68 a[0] += 2; 69 a[0] += 2;
69 Expect.equals(3, a[0]); 70 Expect.equals(3, a[0]);
70 71
71 List trace = new List(); 72 List trace = new List();
72 getB(trace)[getIndex(trace)] += 37; 73 getB(trace)[getIndex(trace)] += 37;
73 74
74 Expect.listEquals([-1, -2, -3, 42, 100, -4, 101, 37, -5, 42, 102], trace); 75 Expect.listEquals([-1, -2, -3, 42, 100, -4, 101, 37, -5, 42, 102], trace);
75 } 76 }
OLDNEW
« no previous file with comments | « tests/compiler/dart2js_extra/code_motion_exception_test.dart ('k') | tests/compiler/dart2js_extra/conditional_send_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698