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

Side by Side Diff: tests/language/constructor8_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
« no previous file with comments | « tests/language/constructor7_test.dart ('k') | tests/language/constructor_body_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) 2013, the Dart project authors. Please see the AUTHORS file 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 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 // Regression test for dart2js that used to crash on this program. 5 // Regression test for dart2js that used to crash on this program.
8 6
9 class A { 7 class A {
10 var b; 8 var b;
11 9
12 // The parameter check here used to confuse the SSA builder when it 10 // The parameter check here used to confuse the SSA builder when it
13 // created the call to the constructor body. 11 // created the call to the constructor body.
14 A([Map a]) : b = ?a { 12 A([Map a]) : b = ?a {
15 Expect.isTrue(b); 13 Expect.isTrue(b);
16 } 14 }
17 15
18 // The closure in the constructor body used to confuse the SSA builder 16 // The closure in the constructor body used to confuse the SSA builder
19 // when it created the call to the constructor body. 17 // when it created the call to the constructor body.
20 A.withClosure(Map a) { 18 A.withClosure(Map a) {
21 var c; 19 var c;
22 var f = () { return c = 42; }; 20 var f = () { return c = 42; };
23 b = f(); 21 b = f();
24 Expect.equals(42, b); 22 Expect.equals(42, b);
25 Expect.equals(42, c); 23 Expect.equals(42, c);
26 } 24 }
27 } 25 }
28 26
29 main() { 27 main() {
30 new A(null); 28 new A(null);
31 new A({}); 29 new A({});
32 new A.withClosure(null); 30 new A.withClosure(null);
33 new A.withClosure({}); 31 new A.withClosure({});
34 } 32 }
OLDNEW
« no previous file with comments | « tests/language/constructor7_test.dart ('k') | tests/language/constructor_body_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698