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

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

Issue 10860018: Fix null-equality comparison for unoptimized branch code. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 4 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/co19/co19-runtime.status ('k') | no next file » | 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 5
6 class A { 6 class A {
7 bool _result; 7 bool _result;
8 A(this._result); 8 A(this._result);
9 operator ==(x) { return _result; } 9 operator ==(x) { return _result; }
10 } 10 }
(...skipping 22 matching lines...) Expand all
33 Expect.isTrue(null == null); 33 Expect.isTrue(null == null);
34 Expect.isFalse(null != null); 34 Expect.isFalse(null != null);
35 35
36 Expect.throws(() => death() == 5); 36 Expect.throws(() => death() == 5);
37 Expect.isFalse(death() == nullFn()); 37 Expect.isFalse(death() == nullFn());
38 Expect.isFalse(nullFn() == death()); 38 Expect.isFalse(nullFn() == death());
39 Expect.isTrue(nullFn() == nullFn()); 39 Expect.isTrue(nullFn() == nullFn());
40 Expect.isTrue(death() != nullFn()); 40 Expect.isTrue(death() != nullFn());
41 Expect.isTrue(nullFn() != death()); 41 Expect.isTrue(nullFn() != death());
42 Expect.isFalse(nullFn() != nullFn()); 42 Expect.isFalse(nullFn() != nullFn());
43
44 if (death() == nullFn()) {
45 throw "failed";
46 }
47 if (death() != nullFn()) {
48 } else {
49 throw "failed";
50 }
43 } 51 }
44 52
45 main() { 53 main() {
46 for (int i = 0; i < 1000; i++) tests(); 54 for (int i = 0; i < 1000; i++) tests();
47 } 55 }
OLDNEW
« no previous file with comments | « tests/co19/co19-runtime.status ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698