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

Side by Side Diff: tests/compiler/dart2js_extra/nan_negate_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
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 import "package:expect/expect.dart";
6
7 // Don't convert !(a op b) to (a neg-op b) when a or b might be NaN. 5 // Don't convert !(a op b) to (a neg-op b) when a or b might be NaN.
8 test(double n) { 6 test(double n) {
9 // Force known type to double, preserves NaN. 7 // Force known type to double, preserves NaN.
10 n = 0.0 + n; 8 n = 0.0 + n;
11 Expect.isFalse(n >= 0); 9 Expect.isFalse(n >= 0);
12 Expect.isTrue(!(n < 0)); 10 Expect.isTrue(!(n < 0));
13 11
14 Expect.isFalse(n <= 0); 12 Expect.isFalse(n <= 0);
15 Expect.isTrue(!(n > 0)); 13 Expect.isTrue(!(n > 0));
16 14
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after
110 main() { 108 main() {
111 test(hideConstant(27, double.NAN)); 109 test(hideConstant(27, double.NAN));
112 testConstant(); 110 testConstant();
113 } 111 }
114 112
115 double hideConstant(int n, double result) { 113 double hideConstant(int n, double result) {
116 if (n == 1) return result; 114 if (n == 1) return result;
117 if ((n & 1) == 0) return hideConstant(n >> 1, result); 115 if ((n & 1) == 0) return hideConstant(n >> 1, result);
118 return hideConstant(3 * n + 1, result); 116 return hideConstant(3 * n + 1, result);
119 } 117 }
OLDNEW
« no previous file with comments | « tests/compiler/dart2js_extra/named_parameter_test.dart ('k') | tests/compiler/dart2js_extra/no_such_method_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698