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

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