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

Unified Diff: tests/lib/math/double_pow_test.dart

Issue 87953002: Change Expect.identical(NaN, x) to not assume NaNs are identical. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 1 month 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « tests/corelib/num_parse_test.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/lib/math/double_pow_test.dart
diff --git a/tests/lib/math/double_pow_test.dart b/tests/lib/math/double_pow_test.dart
index c3ce04cc8b5369fc3ae121620cc8b10f3e76fde5..ca35db051b513f4b2d5bcf89b68020cc67527c9d 100644
--- a/tests/lib/math/double_pow_test.dart
+++ b/tests/lib/math/double_pow_test.dart
@@ -66,18 +66,18 @@ main() {
}
for (var d in samples) {
// otherwise, if either `x` or `y` is NaN then the result is NaN.
- if (d != 0.0) Expect.identical(NaN, pow(NaN, d), "$d");
- if (d != 1.0) Expect.identical(NaN, pow(d, NaN), "$d");
+ if (d != 0.0) Expect.isTrue(pow(NaN, d).isNaN, "$d");
+ if (d != 1.0) Expect.isTrue(pow(d, NaN).isNaN, "$d");
}
for (var d in samples) {
// if `x` is a finite and strictly negative and `y` is a finite non-integer,
// the result is NaN.
if (d < 0 && !d.isInfinite) {
- Expect.identical(NaN, pow(d, 0.5), "$d");
- Expect.identical(NaN, pow(d, -0.5), "$d");
- Expect.identical(NaN, pow(d, 1.5), "$d");
- Expect.identical(NaN, pow(d, -1.5), "$d");
+ Expect.isTrue(pow(d, 0.5).isNaN, "$d");
+ Expect.isTrue(pow(d, -0.5).isNaN, "$d");
+ Expect.isTrue(pow(d, 1.5).isNaN, "$d");
+ Expect.isTrue(pow(d, -1.5).isNaN, "$d");
}
}
« no previous file with comments | « tests/corelib/num_parse_test.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698