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

Side by Side Diff: tests/language/field_optimization3_test.dart

Issue 12743005: Revert "Remove Expect from core library." (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Reupload (first upload failed). Created 7 years, 9 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
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";
6
7 // Dart test program to test type-based optimization on fields. 5 // Dart test program to test type-based optimization on fields.
8 6
9 class A { 7 class A {
10 var a = 0; 8 var a = 0;
11 var b = 0; 9 var b = 0;
12 foo() { 10 foo() {
13 var c = b + 27; 11 var c = b + 27;
14 for (var i = 0; i < 1 ; i++) { 12 for (var i = 0; i < 1 ; i++) {
15 for (var j = 0; j < 1; j++) { 13 for (var j = 0; j < 1; j++) {
16 Expect.equals(50, c + 23); 14 Expect.equals(50, c + 23);
17 } 15 }
18 } 16 }
19 return a > 0.2; 17 return a > 0.2;
20 } 18 }
21 setA(value) { a = value; } 19 setA(value) { a = value; }
22 setB(value) { b = value; } 20 setB(value) { b = value; }
23 operator >(other) => other == 0.2; 21 operator >(other) => other == 0.2;
24 } 22 }
25 23
26 main() { 24 main() {
27 var a = new A(); 25 var a = new A();
28 Expect.isFalse(a.foo()); 26 Expect.isFalse(a.foo());
29 a.setA(new A()); 27 a.setA(new A());
30 a.setB(0); 28 a.setB(0);
31 Expect.isTrue(a.foo()); 29 Expect.isTrue(a.foo());
32 } 30 }
OLDNEW
« no previous file with comments | « tests/language/field_optimization2_test.dart ('k') | tests/language/field_optimization_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698