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

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

Issue 18563006: More tests updated to optimize code (Part 2). (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 5 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/double_modulo_test.dart ('k') | tests/language/exception_in_increment_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 // VMOptions=--optimization-counter-threshold=10
4 5
5 import "package:expect/expect.dart"; 6 import "package:expect/expect.dart";
6 7
7 8
8 class A { 9 class A {
9 bool _result; 10 bool _result;
10 A(this._result); 11 A(this._result);
11 operator ==(x) { return _result; } 12 operator ==(x) { return _result; }
12 } 13 }
13 14
(...skipping 13 matching lines...) Expand all
27 Expect.isFalse(alwaysFalse == alwaysFalse); 28 Expect.isFalse(alwaysFalse == alwaysFalse);
28 Expect.isTrue(alwaysFalse != alwaysFalse); 29 Expect.isTrue(alwaysFalse != alwaysFalse);
29 Expect.isTrue(alwaysTrue == alwaysTrue); 30 Expect.isTrue(alwaysTrue == alwaysTrue);
30 Expect.isTrue(alwaysTrue == 5); 31 Expect.isTrue(alwaysTrue == 5);
31 Expect.isFalse(alwaysTrue == null); 32 Expect.isFalse(alwaysTrue == null);
32 Expect.isFalse(null == alwaysTrue); 33 Expect.isFalse(null == alwaysTrue);
33 Expect.isTrue(alwaysTrue != null); 34 Expect.isTrue(alwaysTrue != null);
34 Expect.isTrue(null != alwaysTrue); 35 Expect.isTrue(null != alwaysTrue);
35 Expect.isTrue(null == null); 36 Expect.isTrue(null == null);
36 Expect.isFalse(null != null); 37 Expect.isFalse(null != null);
37 38
38 Expect.throws(() => death() == 5); 39 Expect.throws(() => death() == 5);
39 Expect.isFalse(death() == nullFn()); 40 Expect.isFalse(death() == nullFn());
40 Expect.isFalse(nullFn() == death()); 41 Expect.isFalse(nullFn() == death());
41 Expect.isTrue(nullFn() == nullFn()); 42 Expect.isTrue(nullFn() == nullFn());
42 Expect.isTrue(death() != nullFn()); 43 Expect.isTrue(death() != nullFn());
43 Expect.isTrue(nullFn() != death()); 44 Expect.isTrue(nullFn() != death());
44 Expect.isFalse(nullFn() != nullFn()); 45 Expect.isFalse(nullFn() != nullFn());
45 46
46 if (death() == nullFn()) { 47 if (death() == nullFn()) {
47 throw "failed"; 48 throw "failed";
48 } 49 }
49 if (death() != nullFn()) { 50 if (death() != nullFn()) {
50 } else { 51 } else {
51 throw "failed"; 52 throw "failed";
52 } 53 }
53 } 54 }
54 55
55 main() { 56 main() {
56 for (int i = 0; i < 1000; i++) tests(); 57 for (int i = 0; i < 20; i++) tests();
57 } 58 }
OLDNEW
« no previous file with comments | « tests/language/double_modulo_test.dart ('k') | tests/language/exception_in_increment_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698