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

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

Issue 12212016: Remove Expect from core library. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Add deprecation comment for ExpectException and revert one test. Created 7 years, 8 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/language/loop_exchange_test.dart ('k') | tests/language/many_calls_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) 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
5 class A { 7 class A {
6 num x; 8 num x;
7 A() : this.x = 0; 9 A() : this.x = 0;
8 10
9 void bar(){ 11 void bar(){
10 // dart2js hoisted the this.x out of the loop, and missed that setX would 12 // dart2js hoisted the this.x out of the loop, and missed that setX would
11 // change the value. 13 // change the value.
12 for (int i = 1; i < 3; i++) { 14 for (int i = 1; i < 3; i++) {
13 setX(499); 15 setX(499);
14 foo(x); 16 foo(x);
15 break; 17 break;
16 } 18 }
17 } 19 }
18 setX(x) => this.x = x; 20 setX(x) => this.x = x;
19 } 21 }
20 22
21 var saved; 23 var saved;
22 foo(x) => saved = x; 24 foo(x) => saved = x;
23 25
24 main() { 26 main() {
25 A a = new A(); 27 A a = new A();
26 for (int i = 0; i < 1; i++) { 28 for (int i = 0; i < 1; i++) {
27 a.bar(); 29 a.bar();
28 } 30 }
29 Expect.equals(499, saved); 31 Expect.equals(499, saved);
30 } 32 }
OLDNEW
« no previous file with comments | « tests/language/loop_exchange_test.dart ('k') | tests/language/many_calls_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698