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

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