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

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

Issue 10855208: Implement new equality spec. (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
OLDNEW
(Empty)
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
3 // BSD-style license that can be found in the LICENSE file.
4
5
6 class A {
7 bool _result;
8 A(this._result);
9 operator ==(x) { return _result; }
10 }
11
12 tests() {
13 var alwaysTrue = new A(true);
14 var alwaysFalse = new A(false);
15 Expect.isFalse(alwaysFalse == alwaysFalse);
16 Expect.isTrue(alwaysFalse != alwaysFalse);
17 Expect.isTrue(alwaysTrue == alwaysTrue);
18 Expect.isTrue(alwaysTrue == 5);
19 Expect.isFalse(alwaysTrue == null);
20 Expect.isFalse(null == alwaysTrue);
21 Expect.isTrue(alwaysTrue != null);
22 Expect.isTrue(null != alwaysTrue);
23 Expect.isTrue(null == null);
24 Expect.isFalse(null != null);
sra1 2012/08/17 01:34:08 Should also compare cases where both sides are exp
25 }
26
27 main() {
28 for (int i = 0; i < 1000; i++) tests();
29 }
OLDNEW
« runtime/vm/intermediate_language_x64.cc ('K') | « runtime/vm/intermediate_language_x64.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698